Add a "idle" method to the state structure
[neverball] / macosx / changes.osx
1 24-10-2006
2
3 Xcode project including script for building directly a ready to use dmg file
4
5 -------------------------------------------------------------------------------
6 - Makefile.osx added (use Makefile -f Makefile.osx)
7
8 - osx directory added contains : 
9         + SDLMain.h and SDLMain.m
10         + *.icns
11         + mkdmg (little script for creating dmg file)
12
13 - Warning correction:
14         share/gui.c: In function `gui_init':
15         share/gui.c:235: warning: passing arg 2 of `glGetIntegerv' from incompatible pointer type       
16         share/gui.c (line 231) int m; -> GLint m;
17
18 - Fix in ball/main.c (line 100) and putt/main.c (line 106)
19         mouse motion events problem 
20         suppression of APPLE case : "#ifdef __APPLE__"
21         the same code as x86
22         
23 - not real colors in screenshots because BMP file is little endian format
24          change image_snap in share/image.c (take screenshot in 32bits and special stuff for big endian)
25          
26          #include <SDL_endian.h>
27          ...
28          void image_snap(char *filename)
29         {
30                 ...
31                 SDL_Surface *buf = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32,
32                                             RMASK,GMASK,255,BMASK );
33                                                                                         
34                 SDL_Surface *img = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32,
35                 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
36                         RMASK,GMASK,255,BMASK   
37                 #else
38                         RMASK,GMASK,BMASK,255 
39                 #endif
40                 );                                                                      
41
42                 glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf->pixels);
43                 
44                 for (i = 0; i < h; i++)
45                         memcpy((GLubyte *) img->pixels + 4 * w * i,
46                (GLubyte *) buf->pixels + 4 * w * (h - i), 4 * w);
47                 ...
48 }
49
50 - Multilang support with gettext
51         gettext is a linux tool that uses the LANG environement variable
52         and LANG as no value is osX 
53         so in terminal.app 
54                 $ export LANG=fr 
55                 $ open neverball.app
56                 will launch neverball in french
57                 
58         But when you launch neverball in finder (by double clic) it will use english because LANG var has no value
59         To fix LANG in osX add it in .MacOSX/environment.plist by adding 
60         
61         <?xml version="1.0" encoding="UTF-8"?>
62         <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
63         <plist version="1.0">
64         <dict>
65         <key>LANG</key><string>Fr</string>      
66         </dict>
67         </plist>   
68         
69         and relaunch user session
70         launching neverball in finder will use French
71         
72         but when launch terminal it will complain about an error (probably because of Fink) when setting locale.
73         To avoid this error, add in ~/.bashrc 
74         
75         unset LANG 
76         ...
77         test -r /sw/bin/init.sh && . /sw/bin/init.sh # fink line
78         ...
79         export LANG=Fr
80         
81         I notice that Battle for Wesnoth has the same problem. The first launch (in finder) is in english and you can select french language in game preferences that are written in ~/Library/Preferences/Wesnoth/preferences. The next launch will read : locale="fr_FR" in preferences file and launch the game in french.
82