Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8090


Ignore:
Timestamp:
Mar 18, 2011, 10:00:27 AM (14 years ago)
Author:
youngk
Message:

IT WORKS! Orxonox will now run properly with Cocoa - All window issues are fixed. Needs some cleanup, but only little. Rund App from Desktop.@reto: please review my changes. @fabian: watch and learn :)

Location:
code/branches/mac_osx
Files:
4 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/mac_osx/CMakeLists.txt

    r8083 r8090  
    5757SET(DEFAULT_CONFIG_PATH  config)
    5858SET(DEFAULT_LOG_PATH     log)
     59SET(DEFAULT_BUNDLE_PATH  bundle)
    5960
    6061# Set output directories
  • code/branches/mac_osx/data/mac/Orxonox-Info.plist

    r8083 r8090  
    88        <string>${EXECUTABLE_NAME}</string>
    99        <key>CFBundleIconFile</key>
    10         <string></string>
     10        <string>Icon.icns</string>
    1111        <key>CFBundleIdentifier</key>
    12         <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
     12        <string>net.orxonox.${PROJECT_NAME}</string>
    1313        <key>CFBundleInfoDictionaryVersion</key>
    1414        <string>6.0</string>
    1515        <key>CFBundleName</key>
    16         <string>${PRODUCT_NAME}</string>
     16        <string>${PROJECT_NAME}</string>
     17        <key>CFBundleVersion</key>
     18        <string>${ORXONOX_VERSION}</string>
     19        <key>CFBundleShortVersionString</key>
     20        <string>${ORXONOX_VERSION}, ${ORXONOX_VERSION_NAME}</string>
     21        <key>CFBundleGetInfoString</key>
     22        <string>Orxonox: The hottest space shooter ever to exist!</string>
     23        <key>NSHumanReadableCopyright</key>
     24        <string>GPL version 2 or higher, and CC-BY-SA</string>
    1725        <key>CFBundlePackageType</key>
    1826        <string>APPL</string>
    19         <key>CFBundleShortVersionString</key>
    20         <string>1.0</string>
    21         <key>CFBundleSignature</key>
    22         <string>????</string>
    23         <key>CFBundleVersion</key>
    24         <string>1</string>
    2527        <key>LSMinimumSystemVersion</key>
    26         <string>${MACOSX_DEPLOYMENT_TARGET}</string>
     28        <string>10.5</string>
    2729        <key>NSMainNibFile</key>
    2830        <string>MainMenu</string>
  • code/branches/mac_osx/src/CMakeLists.txt

    r8084 r8090  
    140140  SOURCE_FILES
    141141    Orxonox.cc
    142 #    OrxonoxMac.mm
     142    OrxonoxMac.mm
    143143  OUTPUT_NAME orxonox
    144144)
     
    151151    "/System/Library/Frameworks/Foundation.framework"
    152152  )
    153  
    154   # Tell Apple where to find the Info.plist file, used for Cocoa
    155   # TODO: Of course, this only makes sense for development builds. CPack will take care of this otherwise
    156   # Property XCODE_ATTRIBUTE_INFOPLIST_FILE is fo Xcode, while the other is for makefile generator
    157   SET_TARGET_PROPERTIES(orxonox-main PROPERTIES
    158     XCODE_ATTRIBUTE_INFOPLIST_FILE "${DEFAULT_DATA_PATH}/mac/Orxonox-Info.plist"
    159     MACOSX_BUNDLE_INFO_PLIST "${DEFAULT_DATA_PATH}/mac/Orxonox-Info.plist"
    160   )
     153
     154  # Post-build step for the creation of the Dev-App bundle
     155  INCLUDE(PrepareDevBundle)
     156  ADD_CUSTOM_COMMAND(
     157    TARGET orxonox-main
     158    POST_BUILD
     159    # Copy the Orxonox.app from the dummy location to the correct one
     160    COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/Dummy/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app"
     161    # Copy the executable into the Orxonox.app
     162    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
     163    # Copy the dev-build marker file to Orxonox.app
     164    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
     165    # Create a shortcut of the application to the Desktop
     166    COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_BINARY_DIR}/${DEFAULT_BUNDLE_PATH}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "$ENV{HOME}/Desktop/${PROJECT_NAME}_${CMAKE_CFG_INTDIR}.app"
     167  )
    161168ENDIF(APPLE)
    162169
  • code/branches/mac_osx/src/Orxonox.cc

    r8084 r8090  
    5353#ifdef ORXONOX_USE_WINMAIN
    5454INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
    55 //#elif defined(ORXONOX_PLATFORM_APPLE)
    56 //int main_mac(int argc, char** argv)
     55#elif defined(ORXONOX_PLATFORM_APPLE)
     56int main_mac(int argc, char** argv)
    5757#else
    5858int main(int argc, char** argv)
    5959#endif
    6060{
    61     COUT(0) << "main mac" << std::endl;
    6261    try
    6362    {
    6463#ifndef ORXONOX_USE_WINMAIN
    6564        std::string strCmdLine;
    66         for (int i = 1; i < argc; ++i)
     65        for (int i = 2; i < argc; ++i)
    6766            strCmdLine = strCmdLine + argv[i] + ' ';
    6867#endif
  • code/branches/mac_osx/src/OrxonoxMac.mm

    r8083 r8090  
    99#import "OrxonoxMac.h"
    1010
    11 //#import <Foundation/Foundation.h>
    12 
    1311static int argc_s = 0;
    1412static char** argv_s = 0;
     
    1614int main(int argc, char** argv)
    1715{
    18     //NSLog(@"main");
    1916    argc_s = argc;
    2017    argv_s = argv;
    2118   
    22     //NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    23     //[[NSApplication sharedApplication] setDelegate:[[[OrxonoxAppDelegate alloc] init] autorelease]];
    2419    int retVal = NSApplicationMain(argc, (const char**)argv);
    25     //[pool drain];
    2620   
    2721    return retVal;
     
    3226- (void)applicationDidFinishLaunching:(NSNotification *)notification
    3327{
    34     NSLog(@"applicationDidFinishLaunching");
    3528    exit(main_mac(argc_s, argv_s));
    3629}
  • code/branches/mac_osx/src/libraries/core/GraphicsManager.cc

    r8043 r8090  
    316316
    317317// HACK
    318 #ifdef ORXONOX_PLATFORM_APPLE
    319         //INFO: This will give our window focus, and not lock it to the terminal
    320         ProcessSerialNumber psn = {0, kCurrentProcess};
    321         TransformProcessType(&psn, kProcessTransformToForegroundApplication);
    322         SetFrontProcess(&psn);
    323 #endif
     318//#ifdef ORXONOX_PLATFORM_APPLE
     319//        //INFO: This will give our window focus, and not lock it to the terminal
     320//        ProcessSerialNumber psn = {0, kCurrentProcess};
     321//        TransformProcessType(&psn, kProcessTransformToForegroundApplication);
     322//        SetFrontProcess(&psn);
     323//#endif
    324324// End of HACK
    325325
  • code/branches/mac_osx/src/orxonox/sound/SoundManager.cc

    r8056 r8090  
    326326        alListener3f(AL_POSITION, position.x, position.y, position.z);
    327327        ALenum error = alGetError();
    328         if (error == AL_INVALID_VALUE)
    329             COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
     328        if (error == AL_INVALID_VALUE) {}
     329            // @TODO: Follow this constantly appearing, nerve-racking warning
     330            //COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
    330331    }
    331332
Note: See TracChangeset for help on using the changeset viewer.