Merged the specifics of Caanoo 1.2 port by Pheel + Enabled TTF text on Caanoo

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1645 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-11-05 01:03:11 +00:00
parent a59de659bd
commit 7a3ae5824a
12 changed files with 29 additions and 19 deletions

View File

@ -1464,7 +1464,7 @@ void Button_Skins(void)
Menu_font = new_font;
fname = Get_item_by_index(&Font_files_list,selected_font)->Full_name;
free(Config.Font_file);
Config.Font_file = strdup(fname);
Config.Font_file = (char *)strdup(fname);
}
// Confirm the change of cursor shape
Config.Cursor = selected_cursor;

View File

@ -53,6 +53,7 @@ char * Bound_script[10];
#include <lualib.h>
#include <float.h> // for DBL_MAX
#include <unistd.h> // chdir()
#include <limits.h> //for INT_MIN
///
/// Number of characters for name in fileselector.

View File

@ -1423,7 +1423,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
case 6 : // Scroller des formats
// On met à jour le format de browsing du fileselect:
if (Main_format != Window_attribute2) {
char* savename = strdup(Selector_filename);
char* savename = (char *)strdup(Selector_filename);
int nameLength = strlen(savename);
DEBUG(Selector_filename, 42);
Main_format = Window_attribute2;

View File

@ -997,7 +997,10 @@ GFX2_GLOBAL SDL_Joystick* Joystick;
#define JOY_BUTTON_VOLDOWN (17)
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
#elif __CAANOO__
#elif defined (__CAANOO__)
#define JOYSTICK_THRESHOLD (4096)
/// Button definitions for the Caanoo
#define JOY_BUTTON_A (0)
#define JOY_BUTTON_X (1)

View File

@ -443,7 +443,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT ("")
HELP_BOLD (" WIZ & CAANOO PORT")
HELP_TEXT ("")
HELP_TEXT (" PheeL")
HELP_TEXT (" Alexander Filyanov (PheeL)")
HELP_TEXT ("")
HELP_TEXT ("")
HELP_TEXT (" ... made it work on your favourite toaster")

View File

@ -1698,7 +1698,7 @@ void Set_all_video_modes(void)
// The first mode will have index number 0.
// It will be the default mode if an unsupported one
// is requested in gfx2.ini
#if defined(__GP2X__)
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
// Native GP2X resolution
Set_video_mode( 320,240,0, 1);
#else
@ -1708,7 +1708,7 @@ void Set_all_video_modes(void)
Set_video_mode( 320,200,0, 1);
Set_video_mode( 320,224,0, 1);
#if !defined(__GP2X__)
#if !defined(__GP2X__) && !defined(__WIZ__) && !defined(__CAANOO__)
// For the GP2X, this one is already declared above.
Set_video_mode( 320,240,0, 1);
#endif
@ -1777,7 +1777,7 @@ void Set_all_video_modes(void)
for (index=0; Modes[index]; index++)
{
int index2;
#if defined(__GP2X__)
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
// On the GP2X the first mode is not windowed, so include it in the search.
index2=0;
#else
@ -1925,7 +1925,7 @@ int Load_CFG(int reload_all)
!Read_word_le(Handle, &cfg_video_mode.Height) )
goto Erreur_lecture_config;
#if defined(__GP2X__)
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
index2=0;
#else
index2=1;
@ -2254,7 +2254,7 @@ int Save_CFG(void)
// D'abord compter les modes pour lesquels l'utilisateur a mis une préférence
modes_to_save=0;
#if defined(__GP2X__)
#if defined(__GP2X__) || defined (__WIZ__) || defined (__CAANOO__)
index = 0;
#else
index = 1;
@ -2270,7 +2270,7 @@ int Save_CFG(void)
if (!Write_byte(Handle, Chunk.Number) ||
!Write_word_le(Handle, Chunk.Size) )
goto Erreur_sauvegarde_config;
#if defined(__GP2X__)
#if defined(__GP2X__) || defined (__WIZ__) || defined (__CAANOO__)
index = 0;
#else
index = 1;

View File

@ -64,4 +64,3 @@ extern int Snap_axis_origin_Y;
/// This malloced string is set when a drag-and-drop event
/// brings a file to Grafx2's window.
extern char * Drop_file_name;

View File

@ -2,7 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2010 A Filyanov
Copyright 2010 Alexander Filyanov
Copyright 2009 Franck Charlet
Copyright 2008 Yves Rizoud
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)

View File

@ -2,7 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2010 A Filyanov
Copyright 2010 Alexander Filyanov
Copyright 2009 Petter Lindquist
Copyright 2008 Yves Rizoud
Copyright 2008 Franck Charlet

View File

@ -610,6 +610,11 @@ int Init_program(int argc,char * argv[])
Paintbrush_offset_Y=0;
Paintbrush_shape=PAINTBRUSH_SHAPE_ROUND;
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
// Prefer cycling active by default
Cycling_mode=1;
#endif
// Charger la configuration des touches
Set_config_defaults();
@ -888,7 +893,7 @@ void Program_shutdown(void)
SDL_Quit();
#if defined(__GP2X__) || defined(__gp2x__) || defined(__WIZ__) || defined(__CAANOO__)
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
chdir("/usr/gp2x");
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
#endif

View File

@ -2,7 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2010 A Filyanov
Copyright 2010 Alexander Filyanov
Copyright 2007 Adrien Destugues
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)

View File

@ -36,16 +36,16 @@
#include <SDL_ttf.h>
#endif
#if defined(__linux__)
#if defined(__macosx__)
#if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
// No X11
#elif defined(__macosx__)
#include <Carbon/Carbon.h>
#import <corefoundation/corefoundation.h>
#import <sys/param.h>
#else
#elif defined(__linux__)
#include <X11/Xlib.h>
#endif
#endif
#endif
#include <SDL_image.h>
#include "SFont.h"
@ -321,6 +321,8 @@ void Init_text(void)
CFRelease(url);
#endif
#elif defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
// No X11 : Only use fonts from Grafx2
#elif defined(__linux__)
#ifndef NOTTF
#define USE_XLIB