refactored Xcode project to use pre-built frameworks (making it much easier) + more minor cleanup (removed some useless plib stuff left in code)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3516 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
d40f096127
commit
bbce1a0407
@ -257,4 +257,4 @@ namespace GUIEngine
|
||||
|
||||
return singleton;
|
||||
}
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
11
src/ide/Xcode/Config.xcconfig
Normal file
11
src/ide/Xcode/Config.xcconfig
Normal file
@ -0,0 +1,11 @@
|
||||
// Xcode build configuration
|
||||
|
||||
HEADER_SEARCH_PATHS = /usr/local/include /usr/include /usr/local/include/irrlicht/ $(PROJECT_DIR)/../../ $(PROJECT_DIR)/../../bullet/src $(PROJECT_DIR)/../../enet/include
|
||||
|
||||
OTHER_CFLAGS = -Wall -DHAVE_OGGVORBIS=1 -DHAS_SOCKLEN_T -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAS_POLL=1 -DHAS_FCNTL=1 -DHAS_INET_PTON=1 -DHAS_INET_NTOP=1 -DHAS_MSGHDR_FLAGS=1 -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_GLUT=1 -DHAVE_IRRLICHT=1 -DPACKAGE="\"supertuxkart\""
|
||||
|
||||
OTHER_LDFLAGS = -lplibjs -lplibsl -lplibssg -lplibpu -lplibfnt -lplibsg -lplibul -lplibssgaux -lirrlicht
|
||||
LIBRARY_SEARCH_PATHS = /usr/local/lib /usr/lib
|
||||
|
||||
SDKROOT = macosx10.4
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4
|
File diff suppressed because it is too large
Load Diff
24
src/ide/Xcode/SuperTuxKart-Info.plist
Normal file
24
src/ide/Xcode/SuperTuxKart-Info.plist
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>CFBundleName</key>
|
||||
<string>SuperTuxKart</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>stk.icns</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>supertuxkart</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.7</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.7</string>
|
||||
</dict>
|
||||
</plist>
|
BIN
src/ide/Xcode/stk.icns
Normal file
BIN
src/ide/Xcode/stk.icns
Normal file
Binary file not shown.
@ -69,7 +69,7 @@ bool macSetBundlePathIfRelevant(std::string& data_dir)
|
||||
{
|
||||
printf("yes\n");
|
||||
// executable is inside an app bundle, use app bundle-relative paths
|
||||
data_dir = contents + std::string("/Resources/data");
|
||||
data_dir = contents + std::string("/Resources/");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "network/flyable_info.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
|
||||
// static variables:
|
||||
float Flyable::m_st_speed[POWERUP_MAX];
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/coord.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "graphics/mesh_tools.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
|
||||
float KartModel::UNDEFINED = -99.9f;
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "io/file_manager.hpp"
|
||||
#include "lisp/parser.hpp"
|
||||
#include "lisp/lisp.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
float KartProperties::UNDEFINED = -99.9f;
|
||||
|
@ -32,7 +32,6 @@ using namespace irr;
|
||||
#include "modes/world.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/coord.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "physics/btKart.hpp"
|
||||
#include "physics/btUprightConstraint.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Initialise physics.
|
||||
|
@ -68,7 +68,7 @@ void QuadGraph::load(const std::string &filename)
|
||||
const XMLNode *node = xml->getNode(i);
|
||||
if(node->getName()!="edge")
|
||||
{
|
||||
fprintf(stderr, "Incorrect specification in '%s': '%' ignored\n",
|
||||
fprintf(stderr, "Incorrect specification in '%s': '%s' ignored\n",
|
||||
filename.c_str(), node->getName().c_str());
|
||||
continue;
|
||||
}
|
||||
@ -122,7 +122,7 @@ void QuadGraph::GraphNode::addSuccessor(int to, const QuadSet &quad_set)
|
||||
Vec3 next_xyz = quad_set.getCenterOfQuad(to);
|
||||
Vec3 diff = next_xyz - this_xyz;
|
||||
m_distance_to_next.push_back(diff.length());
|
||||
|
||||
|
||||
float theta = -atan2(diff.getX(), diff.getY());
|
||||
m_angle_to_next.push_back(theta);
|
||||
} // addSuccessor
|
||||
} // addSuccessor
|
||||
|
@ -45,7 +45,6 @@
|
||||
#include "race_manager.hpp"
|
||||
#include "tracks/quad_graph.hpp"
|
||||
#include "tracks/quad_set.hpp"
|
||||
#include "utils/ssg_help.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
|
||||
#include <plib/ssg.h>
|
||||
|
@ -25,10 +25,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
// ul.h includes windows.h, so this define is necessary
|
||||
#define _WINSOCKAPI_
|
||||
#include <plib/ul.h>
|
||||
|
||||
#include <fstream>
|
||||
// for mkdir:
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
# include <sys/stat.h>
|
||||
@ -164,7 +161,7 @@ void UserConfig::loadConfig()
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* Checks for existance of the tuxkart configuration directory. If the
|
||||
* Checks for existance of the STK configuration directory. If the
|
||||
* directory does not exist, it will be created. Return values:
|
||||
* 1: config dir exists
|
||||
* 2: does not exist, but was created
|
||||
@ -172,6 +169,38 @@ void UserConfig::loadConfig()
|
||||
*/
|
||||
int UserConfig::CheckAndCreateDir()
|
||||
{
|
||||
// the standard C/C++ libraries don't include anything allowing to check
|
||||
// for directory existance. I work around this by trying to write to it
|
||||
// (no file will be created)
|
||||
const std::string filename = file_manager->getHomeDir() + "/test";
|
||||
|
||||
std::ofstream test(filename.c_str(), std::ios::out);
|
||||
if(test.fail() || !test.is_open())
|
||||
{
|
||||
int bError;
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
bError = _mkdir(file_manager->getHomeDir().c_str() ) != 0;
|
||||
#else
|
||||
bError = mkdir(file_manager->getHomeDir().c_str(), 0755) != 0;
|
||||
#endif
|
||||
if(bError)
|
||||
{
|
||||
fprintf(stderr, "Couldn't create '%s', config files will not be saved.\n",
|
||||
file_manager->getHomeDir().c_str());
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Config directory '%s' successfully created.\n", file_manager->getHomeDir().c_str());
|
||||
return 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(test.is_open()) test.close();
|
||||
return 1;
|
||||
|
||||
/*
|
||||
const std::string DIRNAME = file_manager->getHomeDir();
|
||||
ulDir* u = ulOpenDir(DIRNAME.c_str());
|
||||
if(u)
|
||||
@ -197,6 +226,8 @@ int UserConfig::CheckAndCreateDir()
|
||||
printf("Config directory '%s' successfully created.\n",DIRNAME.c_str());
|
||||
return 2;
|
||||
}
|
||||
*/
|
||||
|
||||
} // CheckAndCreateDir
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -1,179 +0,0 @@
|
||||
// $Id: ssg_help.cpp 837 2006-10-23 07:43:05Z hiker $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2004-2005 Steve Baker <sjbaker1@airmail.net>
|
||||
// Copyright (C) 2006 SuperTuxKart-Team, Joerg Henrichs, Steve Baker
|
||||
//
|
||||
// This program 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 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program 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 this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "utils/ssg_help.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#if 0
|
||||
|
||||
#include <plib/ssg.h>
|
||||
|
||||
namespace SSGHelp
|
||||
{
|
||||
// ------------------------------------------------------------------------
|
||||
/** Make VtTables use display lists.
|
||||
*
|
||||
* Calls recursively 'makeDList' in all ssgVtxTable of the entity.
|
||||
* \param entity Tree in which to create display lists.
|
||||
*/
|
||||
void createDisplayLists(ssgEntity* entity)
|
||||
{
|
||||
if (!entity) return;
|
||||
|
||||
ssgVtxTable* table = dynamic_cast<ssgVtxTable*>(entity);
|
||||
if(table)
|
||||
{
|
||||
if(table->getNumTriangles()>1) table->makeDList();
|
||||
}
|
||||
ssgBranch* branch = dynamic_cast<ssgBranch*>(entity);
|
||||
|
||||
if (branch)
|
||||
{
|
||||
for(ssgEntity* i = branch->getKid(0); i != NULL;
|
||||
i = branch->getNextKid())
|
||||
{
|
||||
createDisplayLists(i);
|
||||
} // for
|
||||
} // if branch
|
||||
|
||||
} // createDisplayLists
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Recursively prints a model.
|
||||
*
|
||||
* Recursively prints a model. That function can most likely be removed, the
|
||||
* print method of the ssg objects do the same.
|
||||
* \param entity The entity ro print (can't be constant because of ssg
|
||||
* functions which are not const correct)
|
||||
* \param indent Indentation to use
|
||||
* \param maxLevel maximum number of levels to print
|
||||
*/
|
||||
void print_model(ssgEntity* entity, const int indent, const int maxLevel)
|
||||
{
|
||||
if(maxLevel <0) return;
|
||||
if (entity)
|
||||
{
|
||||
for(int i = 0; i < indent; ++i)
|
||||
std::cout << " ";
|
||||
|
||||
std::cout << entity->getTypeName() << " " << entity->getType()
|
||||
<< " '"
|
||||
<< entity->getPrintableName()
|
||||
<< "' '"
|
||||
<< (entity->getName() ? entity->getName() : "null")
|
||||
<< "' " << entity << std::endl;
|
||||
|
||||
ssgBranch* branch = dynamic_cast<ssgBranch*>(entity);
|
||||
|
||||
if (branch)
|
||||
{
|
||||
for(ssgEntity* i = branch->getKid(0); i != NULL;
|
||||
i = branch->getNextKid())
|
||||
{
|
||||
print_model(i, indent + 1, maxLevel-1);
|
||||
}
|
||||
} // if branch
|
||||
} // if entity
|
||||
} // print_model
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** MinMax helper function which uses a transform and then computes the
|
||||
* minimum/maximum for this subtree.
|
||||
* \param p Subtree.
|
||||
* \param m Transformation to apply.
|
||||
* \param min On return contains the minimum.
|
||||
* \param max On return contains the maximum.
|
||||
*/
|
||||
static void MinMaxInternal(const ssgEntity* p, sgMat4 m, Vec3 *min, Vec3 *max)
|
||||
{
|
||||
if(const_cast<ssgEntity*>(p)->isAKindOf(ssgTypeLeaf()))
|
||||
{
|
||||
ssgLeaf* l=(ssgLeaf*)p;
|
||||
for(int i=0; i<l->getNumTriangles(); i++)
|
||||
{
|
||||
short v1,v2,v3;
|
||||
sgVec3 vv1, vv2, vv3;
|
||||
|
||||
l->getTriangle(i, &v1, &v2, &v3);
|
||||
|
||||
sgXformPnt3 ( vv1, l->getVertex(v1), m );
|
||||
sgXformPnt3 ( vv2, l->getVertex(v2), m );
|
||||
sgXformPnt3 ( vv3, l->getVertex(v3), m );
|
||||
Vec3 vec3vv1(vv1);
|
||||
Vec3 vec3vv2(vv2);
|
||||
Vec3 vec3vv3(vv3);
|
||||
min->min(vec3vv1);
|
||||
min->min(vec3vv2);
|
||||
min->min(vec3vv3);
|
||||
max->max(vec3vv1);
|
||||
max->max(vec3vv2);
|
||||
max->max(vec3vv3);
|
||||
} // for i<p->getNumTriangles
|
||||
}
|
||||
else if (const_cast<ssgEntity*>(p)->isAKindOf(ssgTypeTransform()))
|
||||
{
|
||||
ssgBaseTransform* t=(ssgBaseTransform*)p;
|
||||
|
||||
sgMat4 tmpT, tmpM;
|
||||
t->getTransform(tmpT);
|
||||
sgCopyMat4(tmpM, m);
|
||||
sgPreMultMat4(tmpM,tmpT);
|
||||
|
||||
for(ssgEntity* e=t->getKid(0); e!=NULL; e=t->getNextKid())
|
||||
{
|
||||
MinMaxInternal(e, tmpM, min, max);
|
||||
} // for i<getNumKids
|
||||
|
||||
}
|
||||
else if (const_cast<ssgEntity*>(p)->isAKindOf(ssgTypeBranch()))
|
||||
{
|
||||
ssgBranch* b =(ssgBranch*)p;
|
||||
for(ssgEntity* e=b->getKid(0); e!=NULL; e=b->getNextKid())
|
||||
{
|
||||
MinMaxInternal(e, m, min, max);
|
||||
} // for i<getNumKids
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("StaticSSG::MinMax: unkown type\n");
|
||||
const_cast<ssgEntity*>(p)->print(stdout, 0, 0);
|
||||
}
|
||||
} // MinMaxInternal
|
||||
// ------------------------------------------------------------------------
|
||||
/** Computes the minimum and maximum x/y coordinates for a ssgEntity.
|
||||
*
|
||||
* Recursively computes the minimum x and y coordinates of a ssgEntity.
|
||||
* \param p ssgEntity for which t compute the extend.
|
||||
* \param min Minimum values in all three dimensions.
|
||||
* \param max Maximum values in all three dimensions.
|
||||
*/
|
||||
void MinMax(const ssgEntity* p, Vec3 *min, Vec3 *max)
|
||||
{
|
||||
sgMat4 mat;
|
||||
sgMakeIdentMat4(mat);
|
||||
*min = Vec3(10000.0f);
|
||||
*max = Vec3(-10000.0f);
|
||||
MinMaxInternal(p, mat,min, max);
|
||||
} // Minmax
|
||||
|
||||
} // namespace SSGHelp
|
||||
#endif
|
||||
/* EOF */
|
@ -1,39 +0,0 @@
|
||||
// $Id: ssg_help.hpp 796 2006-09-27 07:06:34Z hiker $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2004-2005 Steve Baker <sjbaker1@airmail.net>
|
||||
// Copyright (C) 2006 SuperTuxKart-Team, Joerg Henrichs, Steve Baker
|
||||
//
|
||||
// This program 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 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program 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 this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_SSG_HELP_H
|
||||
#define HEADER_SSG_HELP_H
|
||||
|
||||
#if 0
|
||||
#include "vec3.hpp"
|
||||
|
||||
namespace SSGHelp {
|
||||
//* Several useful functions which don't fit anywhere else
|
||||
void createDisplayLists(ssgEntity *entity);
|
||||
void print_model (ssgEntity *entity, const int indent,
|
||||
const int maxLevel);
|
||||
void MinMax (const ssgEntity *p,
|
||||
Vec3 *min, Vec3 *max);
|
||||
}; // namespace SSGHelp
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
Loading…
Reference in New Issue
Block a user