Only in games/crimson/src/: .cvsignore
Only in games/crimson/src/: CVS
Only in crimson-0.4.9/src/: Makefile
Only in crimson-0.4.9/src/: Makefile.in
Only in games/crimson/src/cf: .cvsignore
Only in crimson-0.4.9/src/cf: .deps
Only in games/crimson/src/cf: CVS
Only in crimson-0.4.9/src/cf: Makefile
Only in crimson-0.4.9/src/cf: Makefile.in
diff -r crimson-0.4.9/src/cf/ai.cpp games/crimson/src/cf/ai.cpp
37d36
< 
41a41,42
> #include "YDKmenu.h"
> 
377a379,381
>     // PALMOS port, reset auto-off timer
>     EvtResetAutoOffTimer();
> 
Only in crimson-0.4.9/src/cf: crimson.exe
diff -r crimson-0.4.9/src/cf/game.cpp games/crimson/src/cf/game.cpp
38a39,40
> #include "YDKmenu.h"
> 
840a843,845
> #ifdef PALMOS
>       Sys_PrintF("Internal error: FindPath() failed!");
> #else
841a847
> #endif
1190a1197
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
1206a1214,1217
>     // PALMOS port: use a key to signal quit
>     case SDLK_F12:
>       Quit();
>       break;
1301c1312,1325
<   if ( cursor != mwin->GetMapView()->Cursor() ) SetCursor( cursor );
---
>   if ( cursor != mwin->GetMapView()->Cursor() )
>   {
>     SetCursor( cursor );
>     // PALMOS port
>     // we can now scroll the map
>     view->DisableUpdates();
>     // make sure we always scroll an even number of columns
>     // to avoid strong vertical drift
>     Point pt = mwin->GetMapView()->Cursor();
>     pt.x &= 0xFFFE;
>     mwin->GetMapView()->CenterOnHex( pt );
>     view->EnableUpdates();
>     view->Refresh();
>   }
1377c1401
<   default: return;
---
>   default: break;
1379d1402
< 
1685c1708
<   case G_BUTTON_QUIT:
---
>   case G_BUTTON_QUIT: {
1686a1710,1717
>     string filebuf( get_save_dir() );
>     filebuf.append( last_file_name );
>     filebuf.append( ".sa0" );
>     int err = Save( filebuf.c_str() );
>     if ( err ) {
>       NoteWindow *nw = new NoteWindow( MSG(MSG_ERROR), MSG(MSG_ERR_SAVE), WIN_CLOSE_ESC, view );
> //      break;
>     }
1688c1719
<     break;
---
>     break; }
diff -r crimson-0.4.9/src/cf/initwindow.cpp games/crimson/src/cf/initwindow.cpp
33a34,35
> #include "YDKmenu.h"
> 
523c525,529
<   tname.append( CF_TITLE_SCREEN );
---
>   // PALMOS port
>   if (view->Width() > 320)
>     tname.append( CF_TITLE_SCREEN_480 );
>   else
>     tname.append( CF_TITLE_SCREEN_320 );
543a550
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
922a930,932
> #ifdef PALMOS
>       Sys_PrintF("Error: Could not load language resources from %s", n->Name());
> #else
924a935
> #endif
925a937,939
> #ifdef PALMOS
>       Sys_PrintF("Error: Language catalog '%s' contains %d strings, expected %d", n->Name(), num, CF_MSGS);
> #else
928a943
> #endif
diff -r crimson-0.4.9/src/cf/main.cpp games/crimson/src/cf/main.cpp
26a27
> #include <fcntl.h>
44a46,53
> #include "YDKmenu.h"
> 
> extern UInt32 screenWidth;
> extern UInt32 screenHeight;
> 
> extern UInt32 game_type; // Campaign, Saved Game, vs. AI, vs. 2nd Player
> 
> 
83a93
> 
91,92c101,104
<   struct GUIOptions guiopts = { 800, 600, DISPLAY_BPP, true, true,
<                     MIX_MAX_VOLUME*3/4, MIX_MAX_VOLUME/2, SDL_HWSURFACE, NULL };
---
> //  struct GUIOptions guiopts = { 800, 600, DISPLAY_BPP, true, true,
> //                    MIX_MAX_VOLUME*3/4, MIX_MAX_VOLUME/2, SDL_HWSURFACE, NULL };
>   struct GUIOptions guiopts = { 480, 320, DISPLAY_BPP, false, false,
>                     MIX_MAX_VOLUME*3/4, MIX_MAX_VOLUME/2, SDL_HWSURFACE, "levels/Uprising.lev" };
101,102c113,114
<   if ( display ) {
< 
---
>   if ( display )
>   {
154a167,280
> 
> int palmos_main( int argc, char **argv )
> {
> 	struct GUIOptions guiopts = { 480, 320, DISPLAY_BPP, false, false,
>                     MIX_MAX_VOLUME*3/4, MIX_MAX_VOLUME/2, SDL_HWSURFACE, "levels/GreatBattle.lev" };
> 
> Sys_PrintF("Start Crimson Fields");
> 
> 	parse_options( argc, argv, guiopts );
> 
>     guiopts.px_width = screenWidth;
>     guiopts.px_height = screenHeight;
> 
> 	display = init( guiopts );
> 	if ( display )
> 	{
> 		// always open intro screen
> 		int intro = 1;
> 
> 		display->Refresh();
> 		TitleWindow *twin = new TitleWindow( display );
> 		SDL_ShowCursor(1);
> 
> 		// if title image was successfully loaded, wait for click
> 		if ( twin->Width() > 0 )
> 		{
> 			display->SelectWindow( twin );
> 			twin->EventLoop();
> 			display->CloseWindow( twin );
> 		}
> 
> 		if (game_type == 0)
> 		{
> 			CFOptions.SetCampaign( true );
> 		}
> 		else if (game_type == 1)
> 		{
> 			CFOptions.SetCampaign( false );
> 		}
> 		else if (game_type == 2)
> 		{
> 			CFOptions.SetCampaign( false );
> 			CFOptions.SetGameType( 1 );
> 		}
> 		else if (game_type == 3)
> 		{
> 			CFOptions.SetCampaign( false );
> 			CFOptions.SetGameType( 0 );
> 		}
> /*
> // FIXME: over the net?
> typelabels[2] = MSG(MSG_GAME_PBEM);
> */
> 		if ( guiopts.level )
> 		{
> 			Gam = new Game( display );
> 			intro = Gam->Load( guiopts.level );
> 			Mission *m = Gam->GetMission();
> 			if ( !intro )
> 			{
> 				// default is to play single-player single-map
> 				if ( !(m->GetFlags() & GI_SAVEFILE) )
> 				{
> 					if (game_type == 0)
> 					{
> 						m->GetPlayer(PLAYER_ONE).SetType( HUMAN );
> 					}
> 					else if (game_type == 2)
> 					{
> 						string pnames( "" );
> 						pnames += m->GetPlayer(PLAYER_ONE).Name();
> 						pnames += "|";
> 						pnames += m->GetPlayer(PLAYER_TWO).Name();
> 
> 						DialogWindow *pwin = new DialogWindow( MSG(MSG_PLAYER_SELECTION), MSG(MSG_ASK_SIDE), pnames, 0, 0, display );
> 						pwin->SetButtonID( 0, PLAYER_ONE );
> 						pwin->SetButtonID( 1, PLAYER_TWO );
> 						short rc = pwin->EventLoop();
> 						display->CloseWindow( pwin );
> 						m->GetPlayer( rc ).SetType( HUMAN );
> 					}
> 					else if (game_type == 3)
> 					{
> 							m->GetPlayer(PLAYER_ONE).SetType( HUMAN );
> 							m->GetPlayer(PLAYER_TWO).SetType( HUMAN );
> 					}
> 
> 					// FIXME: Difficulty
> //					m->SetHandicap( 1 << diffwidget->GetValue() );
> 				}
> 
> 				display->Flood( Color(CF_COLOR_SHADOW) );
> 				display->Update();
> 				Gam->InitWindows();
> 				Gam->StartTurn();
> 
> 				GUI_Status status;
> 				do
> 				{
> 					status = display->HandleEvents();
> 				} while ( (status != GUI_QUIT) && (status != GUI_RESTART) );
> 			}
> 
> 			delete Gam;
> 			Gam = NULL;
> 		}
> 		display->CloseAllWindows();
> 	}
> 
> Sys_PrintF("Close Crimson Fields");
> 	do_exit();
> 	return 0;
> }
> 
186a313
> #ifndef PALMOS
190a318
> #endif
235,236c363,364
<   if ( SDL_Init( SDL_INIT_VIDEO ) >= 0 ) {
< 
---
>   if ( SDL_Init( SDL_INIT_VIDEO ) >= 0 )
>   {
246,247c374,375
<       if ( !icons->LoadImageData( datfile ) ) {
< 
---
>       if ( !icons->LoadImageData( datfile ) )
>       {
260,265c388,428
<           else cerr << "Error: Couldn't load font " << datpath << endl;
<         } else cerr << "Error: Couldn't set video mode (" << SDL_GetError() << ')' << endl;
< 
<       } else cerr << "Error: Couldn't read data file" << endl;
<     } else cerr << "Error: Couldn't open " << datpath << endl;
<   } else cerr << "Error: Couldn't initialize ( " << SDL_GetError() << ')' << endl;
---
>           else
>           {
> #ifdef PALMOS
>            Sys_PrintF("Error: Couldn't load font %s", datpath);
> #else
>            cerr << "Error: Couldn't load font " << datpath << endl;
> #endif
>           }
>         }
>         else
>         {
> #ifdef PALMOS
>          Sys_PrintF("Error: Couldn't set video mode (%s)", SDL_GetError());
> #else
>          cerr << "Error: Couldn't set video mode (" << SDL_GetError() << ')' << endl;
> #endif
>         }
>       } else
>       {
> #ifdef PALMOS
>        Sys_PrintF("Error: Couldn't read data file");
> #else
>        cerr << "Error: Couldn't read data file" << endl;
> #endif
>       }
>     } else
>     {
> #ifdef PALMOS
>      Sys_PrintF("Error: Couldn't open %s", datpath);
> #else
>      cerr << "Error: Couldn't open " << datpath << endl;
> #endif
>     }
>   } else
>   {
> #ifdef PALMOS
>    Sys_PrintF("Error: Couldn't initialize (%s)", SDL_GetError());
> #else
>    cerr << "Error: Couldn't initialize ( " << SDL_GetError() << ')' << endl;
> #endif
>   }
280a444,446
> #ifdef PALMOS
>     SDL_MoveToStorage(icons->s_surface);
> #endif
319a486,488
> #ifdef PALMOS
>       Sys_PrintF("Error: Couldn't load language resources for language %s", lid.c_str());
> #else
322c491,495
<     } else if ( num != CF_MSGS ) {
---
> #endif
>     } else if ( num < /*!=*/ CF_MSGS ) {
> #ifdef PALMOS
>       Sys_PrintF("Error: Language catalog for %s contains %d strings, expected %d", lid.c_str(), num, CF_MSGS);
> #else
324a498
> #endif
330a505,507
> #ifdef PALMOS
>       Sys_PrintF("Using default locale (%s) instead", lid.c_str());
> #else
331a509
> #endif
356a535,538
> // PALMOS port
> extern "C"
> int close(int fd);
> 
361,363c543,547
<   ifstream file( crimsonrc.c_str() );
<   if ( file.is_open() ) {
<     string buf;
---
>   int fd;
>   fd = open( crimsonrc.c_str(), O_RDONLY );
>   if ( fd > -1 )
>   {
>     char buf[256];
366d549
<     size_t pos;
368,369c551,552
<     while (!file.eof()) {
<       getline(file, buf);
---
>     while (mygets(fd, buf, sizeof(buf)) >= 0)
>     {
372,383c555,565
<       if ( buf.size() > 0 ) { // ignore empty lines
<         pos = buf.find( ' ' );
<         if ( pos != string::npos ) {
<           linebuf = buf.c_str();
<           val = &linebuf[pos+1];
<           while ( *val == ' ' ) ++val;
< 
<           if ( !strncmp( linebuf, "width", 5 ) ) opts.px_width = atoi(val);
<           else if ( !strncmp( linebuf, "height", 6 ) ) opts.px_height = atoi(val);
<           else if ( !strncmp( linebuf, "fullscreen", 10 ) ) {
<             if ( atoi(val) != 0 ) opts.sdl_flags |= SDL_FULLSCREEN;
<           } else if ( !strncmp( linebuf, "sfxvol", 6 ) ) opts.sfx_vol = atoi(val);
---
>       if ( strlen(buf) > 0 )
>       {
>         // ignore empty lines
>         linebuf = buf;
>         val = strchr( buf, ' ' );
>         if ( val != NULL )
>         {
>           while ( *val == ' ' )
>             ++val;
> 
>           if ( !strncmp( linebuf, "sfxvol", 6 ) ) opts.sfx_vol = atoi(val);
390c572,573
<           else if ( !strncmp( linebuf, "showreplay", 10 ) ) {
---
>           else if ( !strncmp( linebuf, "showreplay", 10 ) )
>           {
394c577
<           } else cerr << "Warning: unrecognized config option in line " << line << endl;
---
>           }
398c581
<     file.close();
---
>     close(fd);
409c592,597
< void save_settings( View *display ) {
---
> // PALMOS port
> extern "C"
> int write(int fd, void* buf, size_t len);
> 
> void save_settings( View *display )
> {
413,431c601,621
<   ofstream file( crimsonrc.c_str() );
<   if ( file.is_open() ) {
<     file << "width " << display->Width() << '\n';
<     file << "height " << display->Height() << '\n';
<     file << StringUtil::strprintf("fullscreen %d", display->IsFullScreen()) << '\n';
<     file << StringUtil::strprintf("sfx %d", Audio::GetSfxState()) << '\n';
<     file << StringUtil::strprintf("music %d", Audio::GetMusicState()) << '\n';
<     file << StringUtil::strprintf("sfxvol %d", Audio::GetSfxVolume()) << '\n';
<     file << StringUtil::strprintf("musicvol %d", Audio::GetMusicVolume()) << '\n';
<     file << "locale " << CFOptions.GetLanguage() << '\n';
<     file << StringUtil::strprintf("showdamage %d", CFOptions.GetDamageIndicator()) << '\n';
<     file << StringUtil::strprintf("showreplay %d",
<             CFOptions.GetTurnReplay() ? (CFOptions.GetQuickReplay() ? 1 : 2) : 0 ) << '\n';
< 
<     const vector<string> &maps = CFOptions.GetUnlockedMaps();
<     for ( vector<string>::const_iterator i = maps.begin(); i != maps.end(); ++i )
<       file << "unlock " << *i << '\n';
< 
<     file.close();
---
>   int fd;
>   fd = open( crimsonrc.c_str(), O_WRONLY | O_CREAT | O_TRUNC );
>   if ( fd > -1 )
>   {
>     char buf[256];
> 
>     sprintf(buf, "sfx %d\n", Audio::GetSfxState());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "music %d\n", Audio::GetMusicState());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "sfxvol %d\n", Audio::GetSfxVolume());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "musicvol %d\n", Audio::GetMusicVolume());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "locale %s\n", CFOptions.GetLanguage());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "showdamage %d\n", CFOptions.GetDamageIndicator());
>     write(fd, buf, strlen(buf));
>     sprintf(buf, "showreplay %d\n", CFOptions.GetTurnReplay() ? (CFOptions.GetQuickReplay() ? 1 : 2) : 0 );
>     write(fd, buf, strlen(buf));
>     close(fd);
519,520c709,719
< void do_exit( void ) {
<   delete Gam;
---
> void do_exit( void )
> {
> 	delete Gam;
> 	if ( display )
> 	{
> 		save_settings( display );
> 		delete display;
> 	}
> 
> 	Audio::ShutdownSfx();
> 	Audio::ShutdownMusic();
522,525c721,722
<   if ( display ) {
<     save_settings( display );
<     delete display;
<   }
---
> 	for ( int i = 0; i < NUM_IMAGES; ++i )
> 		delete Images[i];
527,528c724,725
<   Audio::ShutdownSfx();
<   Audio::ShutdownMusic();
---
> 	TTF_Quit();
> 	SDL_Quit();
530,534c727,729
<   for ( int i = 0; i < NUM_IMAGES; ++i ) delete Images[i];
< 
<   TTF_Quit();
<   SDL_Quit();
<   exit( 0 );
---
> #ifndef PALMOS
> 	exit( 0 );
> #endif
diff -r crimson-0.4.9/src/cf/mapwindow.cpp games/crimson/src/cf/mapwindow.cpp
26a27,28
> #include "YDKmenu.h"
> 
54a57
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
394a398
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/cf/mission.cpp games/crimson/src/cf/mission.cpp
29a30,31
> #include "YDKmenu.h"
> 
78a81,84
>     // PALMOS port
>     if (len == 0)
>       uset = "default";
> 
80a87,89
> #ifdef PALMOS
>       Sys_PrintF("Error: Unit set '%s' not available", uset);
> #else
81a91
> #endif
88a99,102
>     // PALMOS port
>     if (len == 0)
>       tset = "default";
> 
90a105,107
> #ifdef PALMOS
>       Sys_PrintF("Error: Terrain set '%s' not available", tset);
> #else
91a109
> #endif
145a164,167
>   {
> #ifdef PALMOS
>     Sys_PrintF("Warning: Couldn't load %s (incompatible format)", file.Name());
> #else
147a170,171
> #endif
>   }
249,252c273,276
<   file.Write16( unit_set.GetName().length() );
<   file.WriteS( unit_set.GetName() );
<   file.Write16( terrain_set.GetName().length() );
<   file.WriteS( terrain_set.GetName() );
---
>   file.Write16( unit_set.GetName()->length() );
>   file.WriteSp( unit_set.GetName()->c_str(), unit_set.GetName()->size() );
>   file.Write16( terrain_set.GetName()->length() );
>   file.WriteSp( terrain_set.GetName()->c_str(), terrain_set.GetName()->size() );
diff -r crimson-0.4.9/src/cf/options.h games/crimson/src/cf/options.h
30c30,31
< #include <algorithm>
---
> // PALMOS port
> //#include <algorithm>
diff -r crimson-0.4.9/src/cf/path.cpp games/crimson/src/cf/path.cpp
28a29,30
> #include "YDKmenu.h"
> 
44c46
< 
---
>   
234c236
<   while ( dir != -1 ) {
---
>   while ( dir != (Direction)-1 ) {
diff -r crimson-0.4.9/src/cf/unitwindow.cpp games/crimson/src/cf/unitwindow.cpp
29a30,31
> #include "YDKmenu.h"
> 
355a358
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
Only in games/crimson/src/comet: .cvsignore
Only in crimson-0.4.9/src/comet: .deps
Only in games/crimson/src/comet: CVS
Only in crimson-0.4.9/src/comet: Makefile
Only in crimson-0.4.9/src/comet: Makefile.bak
Only in crimson-0.4.9/src/comet: Makefile.in
Only in crimson-0.4.9/src/comet: comet.exe
Only in crimson-0.4.9/src/comet: stderr.txt
Only in games/crimson/src/common: CVS
diff -r crimson-0.4.9/src/common/button.cpp games/crimson/src/common/button.cpp
26a27,28
> #include "YDKmenu.h"
> 
110a113
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
127a131
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
241a246
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
304a310
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
403a410
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
423a431
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/extwindow.cpp games/crimson/src/common/extwindow.cpp
23c23,24
< #include <string.h>
---
> // PALMOS port
> //#include <string.h>
29a31,32
> #include "YDKmenu.h"
> 
189c192,196
<   SetSize( MAX(view->Width()/2, 320), MAX(view->Height()*3/4, 240) );
---
>   // PALMOS port
>   if ((view->Width() < 320) || (view->Height() < 240))
>     SetSize( MAX(view->Width()/2, 160), MAX(view->Height()*3/4, 160) );
>   else
>     SetSize( MAX(view->Width()/2, 320), MAX(view->Height()*3/4, 240) );
589a597
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/extwindow.h games/crimson/src/common/extwindow.h
26c26,27
< #include <string>
---
> // PALMOS port
> #include "string.h"
diff -r crimson-0.4.9/src/common/fileio.cpp games/crimson/src/common/fileio.cpp
37a38,41
> // PALMOS port
> #include "host.h"
> #include "YDKmenu.h"
> 
317a322,327
> // PALMOS port
> int File::WriteSp( const char *ptr, int size ) const {
>   int rc = SDL_RWwrite(fh, ptr, size, 1);
>   return rc;
> }
> 
432c442,443
<   return confd;
---
> //  return confd;
>   return PALMPREFIXDIR;//CURRENTDIR;
471c482
<   return CURRENTDIR;
---
>   return PALMPREFIXDIR;//CURRENTDIR;
diff -r crimson-0.4.9/src/common/fileio.h games/crimson/src/common/fileio.h
34,35c34
< #endif
< #if defined WIN32
---
> #elif defined WIN32
67a67
> // PALMOS_port
114a115,116
>   // PALMOS port
>   int WriteSp( const char *ptr, int size ) const;
Only in crimson-0.4.9/src/common: fileio.h.bak
diff -r crimson-0.4.9/src/common/filewindow.cpp games/crimson/src/common/filewindow.cpp
29a30,33
> #include "globals.h"
> 
> #include "YDKmenu.h"
> 
diff -r crimson-0.4.9/src/common/filewindow.h games/crimson/src/common/filewindow.h
26c26,28
< #include <string>
---
> // PALMOS port
> #include "string.h"
> #include "missing.h"
diff -r crimson-0.4.9/src/common/font.cpp games/crimson/src/common/font.cpp
22a23,24
> #include <string.h>
> 
46c48,50
<   if ( File::Exists( file ) ) {
---
> //  if ( File::Exists( file ) ) {
>   // PALMOS port
>   if (true) {
diff -r crimson-0.4.9/src/common/font.h games/crimson/src/common/font.h
26c26,28
< #include "SDL_ttf.h"
---
> // PALMOS_port
> //#include "SDL_ttf.h"
> #include "missing.h"
diff -r crimson-0.4.9/src/common/gamewindow.cpp games/crimson/src/common/gamewindow.cpp
22a23,24
> #include <string.h>
> 
25a28,29
> #include "YDKmenu.h"
> 
103a108
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/globals.h games/crimson/src/common/globals.h
40c40,41
< #define CF_TITLE_SCREEN	"title.bmp"
---
> #define CF_TITLE_SCREEN_480	"title480x320.bmp"
> #define CF_TITLE_SCREEN_320	"title320x320.bmp"
55,56c56,58
< #define MIN_XRES	320
< #define MIN_YRES	240
---
> // PALMOS port
> #define MIN_XRES	160
> #define MIN_YRES	160
diff -r crimson-0.4.9/src/common/lang.cpp games/crimson/src/common/lang.cpp
23c23,24
< #include <algorithm>
---
> // PALMOS port
> //#include <algorithm>
diff -r crimson-0.4.9/src/common/lang.h games/crimson/src/common/lang.h
26d25
< #include <map>
27a27
> #include <map>
diff -r crimson-0.4.9/src/common/listselect.cpp games/crimson/src/common/listselect.cpp
24a25,26
> #include "YDKmenu.h"
> 
204a207
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/lset.cpp games/crimson/src/common/lset.cpp
26a27,28
> #include "YDKmenu.h"
> 
43c45
<   int rc = tiles.LoadImageData( file, true );
---
>   int rc = tiles->LoadImageData( file, true );
45,46c47,48
<     tiles.DisplayFormat();
<     name.assign( setname );
---
>     tiles->DisplayFormat();
>     name->assign( setname );
48d49
< 
74c75
<   unsigned short gfx_per_line = tiles.Width() / TileWidth();
---
>   unsigned short gfx_per_line = tiles->Width() / TileWidth();
82c83
<   tiles.LowerBlit( dest, srcrect, dstrect.x, dstrect.y );
---
>   tiles->LowerBlit( dest, srcrect, dstrect.x, dstrect.y );
165a167
>           SDL_MoveToStorage(portraits[i].s_surface);
277a280
>   delete fog;
303,308c306,311
<       fog.Create( TileWidth(), TileHeight(), 16, SDL_SWSURFACE );
<       fog.SetAlpha( FOG_ALPHA, SDL_SRCALPHA );
<       fog.SetColorKey( Color(CF_COLOR_WHITE) );
<       fog.DisplayFormat();
<       fog.Flood( Color(CF_COLOR_WHITE) );
<       DrawTile( IMG_FOG, &fog, 0, 0, fog );
---
>       fog->Create( TileWidth(), TileHeight(), 16, SDL_SWSURFACE );
>       fog->SetAlpha( FOG_ALPHA, SDL_SRCALPHA );
>       fog->SetColorKey( Color(CF_COLOR_WHITE) );
>       fog->DisplayFormat();
>       fog->Flood( Color(CF_COLOR_WHITE) );
>       DrawTile( IMG_FOG, fog, 0, 0, *fog );
361c364
<   fog.Blit( dest, fog, px, py );
---
>   fog->Blit( dest, *fog, px, py );
diff -r crimson-0.4.9/src/common/lset.h games/crimson/src/common/lset.h
28c28
< #include <string>
---
> //#include <string>
114,115c114,115
<   TileSet( void ) : num_tiles(0) {}
<   virtual ~TileSet( void ) {}
---
>   TileSet( void ) : num_tiles(0) {name = new string(); tiles = new Surface();}
>   virtual ~TileSet( void ) {delete tiles;}
126c126
<   const string &GetName( void ) const { return name; }
---
>   const string *GetName( void ) const { return name; }
131,132c131,132
<   Surface tiles;
<   string name;
---
>   Surface *tiles;
>   string *name;
165c165
<   TerrainSet( void ) : tt(0) {}
---
>   TerrainSet( void ) : tt(0) {fog = new Surface();}
174c174
<   const Surface &HexMask( void ) const { return fog; }
---
>   const Surface &HexMask( void ) const { return *fog; }
180c180
<   Surface fog;
---
>   Surface *fog;
diff -r crimson-0.4.9/src/common/mapview.cpp games/crimson/src/common/mapview.cpp
24a25,26
> #include "YDKmenu.h"
> 
diff -r crimson-0.4.9/src/common/mapwidget.cpp games/crimson/src/common/mapwidget.cpp
25a26,27
> #include "YDKmenu.h"
> 
188a191
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/slider.cpp games/crimson/src/common/slider.cpp
25a26,27
> #include "YDKmenu.h"
> 
125a128
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
129a133
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
143a148
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
146a152
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
147a154
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
149a157
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
154a163
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
157a167
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
180a191
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
255a267
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/sound.cpp games/crimson/src/common/sound.cpp
29a30,31
> #include "YDKmenu.h"
> 
73a76,78
> #ifdef PALMOS
>       Sys_PrintF("Couldn't initialize audio: %s", SDL_GetError());
> #else
74a80
> #endif
336c342,346
<   if ( !(sample = Mix_LoadWAV( file )) ) {
---
>   if ( !(sample = Mix_LoadWAV( file )) )
>   {
> #ifdef PALMOS
>     Sys_PrintF("Error: Failed to load sfx %s (%s)", file, SDL_GetError());
> #else
337a348
> #endif
diff -r crimson-0.4.9/src/common/surface.cpp games/crimson/src/common/surface.cpp
25a26,27
> #include "YDKmenu.h"
> 
336a339,345
> if ((x > screenWidth) || (y > screenHeight))
> {
> 	Sys_PrintF("x %d y %d w %d h %d dx %d dy %d", x, y, w, h, dx, dy);
> 	Sys_PrintF("not drawn");
> 	return;
> }
> 
461,465c470,477
< 
<   for ( int i = 0; i < num; ++i ) {
<     s_surface->format->palette->colors[i].r = *col++;
<     s_surface->format->palette->colors[i].g = *col++;
<     s_surface->format->palette->colors[i].b = *col++;
---
>   if (s_surface->format->palette != NULL)
>   {
>     for ( int i = 0; i < num; ++i )
>     {
>       s_surface->format->palette->colors[i].r = *col++;
>       s_surface->format->palette->colors[i].g = *col++;
>       s_surface->format->palette->colors[i].b = *col++;
>     }
499c511,512
<   if ( Create( width, height, bpp, (hwsurface ? SDL_HWSURFACE : 0) ) ) return -1;
---
>   // PALMOS port no HW surface
>   if ( Create( width, height, bpp, 0 ) ) return -1;
diff -r crimson-0.4.9/src/common/textbox.cpp games/crimson/src/common/textbox.cpp
28a29,30
> #include "YDKmenu.h"
> 
202a205
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
424a428
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/textbox.h games/crimson/src/common/textbox.h
26c26
< #include <string>
---
> //#include <string>
diff -r crimson-0.4.9/src/common/view.cpp games/crimson/src/common/view.cpp
24a25,26
> #include "YDKmenu.h"
> 
259a262
> //    Sys_PrintF("event: %d", event.type);
260a264
> //    Sys_PrintF("rc: %d", rc);
diff -r crimson-0.4.9/src/common/widget.cpp games/crimson/src/common/widget.cpp
28a29,30
> #include "YDKmenu.h"
> 
112a115
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
270a274
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
288a293
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
342a348
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
diff -r crimson-0.4.9/src/common/window.cpp games/crimson/src/common/window.cpp
24a25,26
> #include "YDKmenu.h"
> 
243c245
< 
---
> //Sys_PrintF("%s %d", __FILE__, __LINE__);
