Changes to compile with gcc3 under apple's april dev tools, possibly other platforms too (only added std:: to some STL stuff in starbrowser, shouldn't break anything elsehwere)
parent
bff39dc21e
commit
1a728e3f94
|
@ -78,13 +78,13 @@
|
|||
-(void)select:(id)inst
|
||||
{
|
||||
if ([inst isKindOfClass:[CelestiaBody class]]) {
|
||||
[self selection].select([(CelestiaBody*)inst body]);
|
||||
[self selection].select((Body*)[(CelestiaBody*)inst body]);
|
||||
}
|
||||
else if ([inst isKindOfClass:[CelestiaStar class]]) {
|
||||
[self selection].select([(CelestiaStar*)inst star]);
|
||||
[self selection].select((Star *)[(CelestiaStar*)inst star]);
|
||||
}
|
||||
else if ([inst isKindOfClass:[CelestiaGalaxy class]]) {
|
||||
[self selection].select([(CelestiaGalaxy*)inst galaxy]);
|
||||
[self selection].select((Galaxy*)[(CelestiaGalaxy*)inst galaxy]);
|
||||
}
|
||||
}
|
||||
-(CelestiaStar*)star
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#import "CelestiaVector.h"
|
||||
#import "CelestiaUniversalCoord.h"
|
||||
|
||||
@interface CelestiaUniversalCoord : NSObject <NSCoding> {
|
||||
@interface CelestiaUniversalCoord : NSObject /*<NSCoding>*/ {
|
||||
NSData* _data;
|
||||
}
|
||||
-(void)encodeWithCoder:(NSCoder*)coder;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface CelestiaVector : NSArray <NSCoding>
|
||||
@interface CelestiaVector : NSArray /*<NSCoding>*/
|
||||
{
|
||||
NSArray* _array;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import "NSArray_Extensions.h"
|
||||
|
||||
@interface MyVector : NSMutableArray <NSCoding> {
|
||||
@interface MyVector : NSMutableArray /*<NSCoding>*/ {
|
||||
NSMutableArray *_array;
|
||||
Class _myClass;
|
||||
}
|
||||
|
|
|
@ -248,11 +248,14 @@
|
|||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
HEADER_SEARCH_PATHS = ../src;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
LIBRARY_SEARCH_PATHS = "/usr/lib/gcc/darwin/2.95.2 /Users/bob/src/celestia/macosx/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = "/usr/lib/gcc/darwin/3.1 /Users/bob/src/celestia/macosx/Frameworks";
|
||||
OTHER_CFLAGS = "";
|
||||
PFE_FILE_C_DIALECTS = "objective-c c++ objective-c++";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = Celestia;
|
||||
SECTORDER_FLAGS = "";
|
||||
USE_GCC3 = YES;
|
||||
USE_GCC3_PFE_SUPPORT = YES;
|
||||
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
|
|
|
@ -90,16 +90,16 @@ struct SolarSystemPredicate
|
|||
|
||||
// Find the nearest/brightest/X-est N stars in a database. The
|
||||
// supplied predicate determines which of two stars is a better match.
|
||||
template<class Pred> static vector<const Star*>*
|
||||
template<class Pred> static std::vector<const Star*>*
|
||||
findStars(const StarDatabase& stardb, Pred pred, int nStars)
|
||||
{
|
||||
vector<const Star*>* finalStars = new vector<const Star*>();
|
||||
std::vector<const Star*>* finalStars = new std::vector<const Star*>();
|
||||
if (nStars == 0)
|
||||
return finalStars;
|
||||
if(nStars > 500)
|
||||
nStars = 500;
|
||||
|
||||
typedef multiset<const Star*, Pred> StarSet;
|
||||
typedef std::multiset<const Star*, Pred> StarSet;
|
||||
StarSet firstStars(pred);
|
||||
|
||||
int totalStars = stardb.size();
|
||||
|
@ -144,14 +144,14 @@ const Star* StarBrowser::nearestStar()
|
|||
Universe* univ = appSim->getUniverse();
|
||||
CloserStarPredicate closerPred;
|
||||
closerPred.pos = pos;
|
||||
vector<const Star*>* stars = findStars(*(univ->getStarCatalog()), closerPred, 1);
|
||||
std::vector<const Star*>* stars = findStars(*(univ->getStarCatalog()), closerPred, 1);
|
||||
const Star *star = (*stars)[0];
|
||||
delete stars;
|
||||
return star;
|
||||
}
|
||||
|
||||
|
||||
vector<const Star*>*
|
||||
std::vector<const Star*>*
|
||||
StarBrowser::listStars(unsigned int nStars)
|
||||
{
|
||||
Universe* univ = appSim->getUniverse();
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define MIN(a,b) ((a<b)?a:b)
|
||||
#endif
|
||||
|
||||
|
||||
class StarBrowser
|
||||
{
|
||||
public:
|
||||
|
@ -32,8 +33,8 @@ class StarBrowser
|
|||
|
||||
StarBrowser();
|
||||
StarBrowser(Simulation *_appSim, int pred = NearestStars);
|
||||
std::vector<const Star*>* listStars(unsigned int);
|
||||
void setSimulation(Simulation *_appSim);
|
||||
vector<const Star*>* listStars(unsigned int);
|
||||
const Star *nearestStar(void);
|
||||
bool setPredicate(int pred);
|
||||
void refresh();
|
||||
|
|
Loading…
Reference in New Issue