Line data Source code
1 0 : /* 2 : 3 : OOStandaloneAtmosphereGenerator.h 4 : 5 : Generator for planet atmospheres when the planet is using a 6 : non-generated diffuse map. 7 : 8 : 9 : Oolite 10 : Copyright (C) 2004-2013 Giles C Williams and contributors 11 : 12 : This program is free software; you can redistribute it and/or 13 : modify it under the terms of the GNU General Public License 14 : as published by the Free Software Foundation; either version 2 15 : of the License, or (at your option) any later version. 16 : 17 : This program is distributed in the hope that it will be useful, 18 : but WITHOUT ANY WARRANTY; without even the implied warranty of 19 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 : GNU General Public License for more details. 21 : 22 : You should have received a copy of the GNU General Public License 23 : along with this program; if not, write to the Free Software 24 : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 : MA 02110-1301, USA. 26 : 27 : */ 28 : 29 : #import "OOTextureGenerator.h" 30 : #import "OOMaths.h" 31 : 32 : 33 0 : typedef struct OOStandaloneAtmosphereGeneratorInfo 34 : { 35 0 : RANROTSeed seed; 36 : 37 0 : unsigned width; 38 0 : unsigned height; 39 : 40 : // Atmosphere parameters. 41 0 : float cloudAlpha; 42 0 : float cloudFraction; 43 0 : FloatRGB airColor; 44 0 : FloatRGB cloudColor; 45 0 : FloatRGB paleCloudColor; 46 : 47 : // Noise generation stuff. 48 0 : float *fbmBuffer; 49 : 50 0 : uint16_t *permutations; 51 : 52 0 : unsigned planetAspectRatio; 53 0 : unsigned planetScaleOffset; 54 0 : BOOL perlin3d; 55 0 : } OOStandaloneAtmosphereGeneratorInfo; 56 : 57 : 58 : 59 0 : @interface OOStandaloneAtmosphereGenerator: OOTextureGenerator 60 : { 61 : @private 62 0 : OOStandaloneAtmosphereGeneratorInfo _info; 63 0 : unsigned _planetScale; 64 : } 65 : 66 : 67 0 : - (id) initWithPlanetInfo:(NSDictionary *)planetInfo; 68 : 69 0 : + (OOTexture *) planetTextureWithInfo:(NSDictionary *)planetInfo; 70 0 : + (BOOL) generateAtmosphereTexture:(OOTexture **)texture withInfo:(NSDictionary *)planetInfo; 71 : 72 : @end