Changeset 97 for abuse/trunk/src


Ignore:
Timestamp:
Mar 9, 2008, 7:22:52 PM (11 years ago)
Author:
Sam Hocevar
Message:
  • Updated the Mac OS X port, thanks to Julian Mayer.
Location:
abuse/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/specs.cpp

    r90 r97  
    932932void write_uint8(FILE *fp, uint8_t x) { fputc((unsigned char)x,fp); }
    933933
    934 uint32_t read_other_int32(FILE *fp)
     934uint32_t read_other_uint32(FILE *fp)
    935935{
    936936  uint32_t x;
  • abuse/trunk/src/imlib/system.h

    r90 r97  
    1111#define __SYS__
    1212
    13 
    14 #ifdef WORDS_BIGENDIAN
    15   #define BIG_ENDIANS
    16 #else
    17   #define LITTLE_ENDIANS
    18 #endif
    19 
     13#include <SDL.h>
    2014
    2115#include <unistd.h>
     
    2721   ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24))
    2822
    29 #if defined BIG_ENDIANS
     23#if SDL_BYTEORDER == SDL_BIG_ENDIAN
    3024#define LONG int32_t
    3125#define uint16_to_intel(x) uint16_swap(x)
  • abuse/trunk/src/imlib/xwdread.cpp

    r56 r97  
    2121#include "video.hpp"
    2222#include "dos.h"
     23#ifndef __APPLE__
    2324#include "main.hpp"
     25#endif
    2426#include "macs.hpp"
    2527#include "image24.hpp"
     
    296298  int i,j;
    297299  uint8_t *sl;
    298 #if BYTE_ORDER!=BIG_ENDIAN
    299   printf("little guys\n");
    300 #endif
     300
    301301  printf("getting image, bits_per_item = %d %d %d\n",bits_per_item,bits_used,bit_order==MSBFirst);
    302302  for (i=0; i<im->height(); i++)
  • abuse/trunk/src/net/tcpip.hpp

    r57 r97  
    99#include <sys/types.h>
    1010#include "isllist.hpp"
    11 
    12 #ifdef __APPLE__
    13 typedef int socklen_t;
    14 #endif
    1511
    1612#if (defined(__APPLE__) && !defined(__MACH__))
  • abuse/trunk/src/sdlport/setup.cpp

    r68 r97  
    2727#ifdef HAVE_OPENGL
    2828#ifdef __APPLE__
     29#include <Carbon/Carbon.h>
    2930#include <OpenGL/gl.h>
    3031#include <OpenGL/glu.h>
     
    9091    {
    9192        fputs( "; Abuse-SDL Configuration file\n\n", fd );
     93        fputs( "; Startup fullscreen\nfullscreen=0\n\n", fd );
     94                #ifdef __APPLE__
     95        fputs( "; Use DoubleBuffering\ndoublebuf=1\n\n", fd );
     96        fputs( "; Use OpenGL\ngl=1\n\n", fd );
     97        #else
     98                fputs( "; Use DoubleBuffering\ndoublebuf=0\n\n", fd );
     99        fputs( "; Use OpenGL\ngl=0\n\n", fd );
    92100        fputs( "; Location of the datafiles\ndatadir=/var/games/abuse\n\n", fd );
    93         fputs( "; Startup fullscreen\nfullscreen=0\n\n", fd );
    94         fputs( "; Use DoubleBuffering\ndoublebuf=0\n\n", fd );
    95         fputs( "; Use mono audio only\nmono=0\n\n", fd );
     101                #endif
     102                fputs( "; Use mono audio only\nmono=0\n\n", fd );
    96103        fputs( "; Grab the mouse to the window\ngrabmouse=0\n\n", fd );
    97104        fputs( "; Set the scale factor\nscale=2\n\n", fd );
    98         fputs( "; Use OpenGL\ngl=0\n\n", fd );
    99         fputs( "; Use anti-aliasing (with gl=1 only)\nantialias=1\n\n", fd );
     105                fputs( "; Use anti-aliasing (with gl=1 only)\nantialias=1\n\n", fd );
    100106//        fputs( "; Set the width of the window\nx=320\n\n", fd );
    101107//        fputs( "; Set the height of the window\ny=200\n\n", fd );
     
    339345    // Initialise default settings
    340346    flags.fullscreen        = 0;            // Start in a window
    341     flags.doublebuf            = 0;            // No double buffering
    342347    flags.mono                = 0;            // Enable stereo sound
    343348    flags.nosound            = 0;            // Enable sound
     
    346351    flags.xres = xres        = 320;            // Default window width
    347352    flags.yres = yres        = 200;            // Default window height
     353#ifdef __APPLE__       
     354    flags.gl                = 1;            // Use opengl
     355    flags.doublebuf            = 1;            // Do double buffering
     356#else
    348357    flags.gl                = 0;            // Don't use opengl
     358    flags.doublebuf            = 0;            // No double buffering
     359        #endif
    349360#ifdef HAVE_OPENGL
    350361    flags.antialias            = GL_NEAREST;    // Don't anti-alias
     
    403414    // Set the datadir to a default value
    404415    // (The current directory)
     416        #ifdef __APPLE__
     417        UInt8 buffer[255];
     418    CFURLRef bundleurl = CFBundleCopyBundleURL(CFBundleGetMainBundle());
     419        CFURLRef url = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, bundleurl, CFSTR("Contents/Resources/data"), true);
     420       
     421        if (!CFURLGetFileSystemRepresentation(url, true, buffer, 255))
     422        {
     423                exit(1);
     424        }
     425        else
     426                set_filename_prefix( (const char*)buffer );
     427        #else
    405428    set_filename_prefix( EXPDATADIR );
    406 
     429        #endif
     430       
    407431    // Load the users configuration
    408432    readRCFile();
Note: See TracChangeset for help on using the changeset viewer.