Lua version now displayed in stats. Now using Lua 5.2 on Windows. Add modified gfx2def.ini, forgotten in previous revision
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2000 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									144a28412b
								
							
						
					
					
						commit
						2e16f0bec3
					
				@ -10,7 +10,7 @@ Grafx2 compilation and installation
 | 
				
			|||||||
* libpng (not on MacOSX)
 | 
					* libpng (not on MacOSX)
 | 
				
			||||||
* FreeType library (optional, for truetype fonts)
 | 
					* FreeType library (optional, for truetype fonts)
 | 
				
			||||||
* SDL_ttf library (optional, for truetype fonts)
 | 
					* SDL_ttf library (optional, for truetype fonts)
 | 
				
			||||||
* Lua library v5.1 (optional, for Lua scripting)
 | 
					* Lua library v5.1 or v5.2 (optional, for Lua scripting)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Extra requirements for Windows:
 | 
					Extra requirements for Windows:
 | 
				
			||||||
* a POSIX environment: MSYS is fine, maybe Cygwin would work as well.
 | 
					* a POSIX environment: MSYS is fine, maybe Cygwin would work as well.
 | 
				
			||||||
@ -175,7 +175,7 @@ SDL_ttf:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Lua:
 | 
					Lua:
 | 
				
			||||||
  (optional)
 | 
					  (optional)
 | 
				
			||||||
  http://www.lua.org/ftp/lua-5.1.4.tar.gz
 | 
					  http://www.lua.org/ftp/lua-5.2.1.tar.gz
 | 
				
			||||||
  Uncompress in temporary directory
 | 
					  Uncompress in temporary directory
 | 
				
			||||||
  Use sh shell
 | 
					  Use sh shell
 | 
				
			||||||
  make mingw
 | 
					  make mingw
 | 
				
			||||||
 | 
				
			|||||||
@ -407,4 +407,9 @@
 | 
				
			|||||||
  ;
 | 
					  ;
 | 
				
			||||||
  Tilemap_count = no; (Default no)
 | 
					  Tilemap_count = no; (Default no)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ; Enables the virtual keyboard when the user enters a textbox.
 | 
				
			||||||
 | 
					  ;
 | 
				
			||||||
 | 
					  ; 0=Auto (guess), 1=ON, 2=OFF
 | 
				
			||||||
 | 
					  Use_virtual_keyboard = 0; (Default 0)
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  ; end of configuration
 | 
					  ; end of configuration
 | 
				
			||||||
 | 
				
			|||||||
@ -143,6 +143,11 @@ do { \
 | 
				
			|||||||
    return luaL_error(L, "%s: Expected %d arguments, but found %d.", func_name, (num), nb_args); \
 | 
					    return luaL_error(L, "%s: Expected %d arguments, but found %d.", func_name, (num), nb_args); \
 | 
				
			||||||
} while(0)
 | 
					} while(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const char * Lua_version(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return LUA_VERSION_MAJOR "." LUA_VERSION_MINOR;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Updates the screen colors after a running screen has modified the palette.
 | 
					// Updates the screen colors after a running screen has modified the palette.
 | 
				
			||||||
void Update_colors_during_script(void)
 | 
					void Update_colors_during_script(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -2142,9 +2147,18 @@ void Button_Brush_Factory(void)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else // NOLUA
 | 
					#else // NOLUA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Button_Brush_Factory(void)
 | 
					void Button_Brush_Factory(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    Verbose_message("Error!", "The brush factory is not available in this build of GrafX2.");
 | 
					    Verbose_message("Error!", "The brush factory is not available in this build of GrafX2.");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// Returns a string stating the included Lua engine version,
 | 
				
			||||||
 | 
					/// or "Disabled" if Grafx2 is compiled without Lua.
 | 
				
			||||||
 | 
					const char * Lua_version(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  return "Disabled";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -11,3 +11,8 @@ extern char * Bound_script[10];
 | 
				
			|||||||
/// Before: Cursor hidden
 | 
					/// Before: Cursor hidden
 | 
				
			||||||
/// After: Cursor shown
 | 
					/// After: Cursor shown
 | 
				
			||||||
void Run_numbered_script(byte index);
 | 
					void Run_numbered_script(byte index);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// Returns a string stating the included Lua engine version,
 | 
				
			||||||
 | 
					/// or "Disabled" if Grafx2 is compiled without Lua.
 | 
				
			||||||
 | 
					const char * Lua_version(void);
 | 
				
			||||||
							
								
								
									
										60
									
								
								src/help.c
									
									
									
									
									
								
							
							
						
						
									
										60
									
								
								src/help.c
									
									
									
									
									
								
							@ -57,6 +57,7 @@
 | 
				
			|||||||
#include "hotkeys.h"
 | 
					#include "hotkeys.h"
 | 
				
			||||||
#include "errors.h"
 | 
					#include "errors.h"
 | 
				
			||||||
#include "pages.h"
 | 
					#include "pages.h"
 | 
				
			||||||
 | 
					#include "factory.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern char Program_version[]; // generated in pversion.c
 | 
					extern char Program_version[]; // generated in pversion.c
 | 
				
			||||||
extern char SVN_revision[]; // generated in pversion.c
 | 
					extern char SVN_revision[]; // generated in pversion.c
 | 
				
			||||||
@ -690,6 +691,7 @@ void Button_Stats(void)
 | 
				
			|||||||
  dword color_usage[256];
 | 
					  dword color_usage[256];
 | 
				
			||||||
  unsigned long long freeRam;
 | 
					  unsigned long long freeRam;
 | 
				
			||||||
  qword mem_size = 0;
 | 
					  qword mem_size = 0;
 | 
				
			||||||
 | 
					  int y;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Open_window(310,174,"Statistics");
 | 
					  Open_window(310,174,"Statistics");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -701,17 +703,20 @@ void Button_Stats(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  Window_set_normal_button(120,153,70,14,"OK",0,1,KEY_ESC); // 1
 | 
					  Window_set_normal_button(120,153,70,14,"OK",0,1,KEY_ESC); // 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Affichage du numéro de version
 | 
					  y=19; // row for first line
 | 
				
			||||||
  Print_in_window(10,19,"Program version:",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(10,y,"Program version:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
  sprintf(buffer,"%s.%s",Program_version, SVN_revision);
 | 
					  sprintf(buffer,"%s.%s",Program_version, SVN_revision);
 | 
				
			||||||
  Print_in_window(146,19,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(146,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
  Print_in_window(10,35,"Build options:",STATS_TITLE_COLOR,MC_Black);
 | 
					  y+=16;
 | 
				
			||||||
  Print_in_window(146,35,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(10,y,"Build options:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  Print_in_window(146,y,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  y+=8;
 | 
				
			||||||
 | 
					  Print_in_window(10,y,"Lua version:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  Print_in_window_limited(146,y,Lua_version(),10,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  y+=16;
 | 
				
			||||||
 | 
					  Print_in_window(10,y,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
#if defined (__MINT__)
 | 
					#if defined (__MINT__)
 | 
				
			||||||
  // Display free TT/ST RAM
 | 
					  // Display free TT/ST RAM
 | 
				
			||||||
  Print_in_window(10,43,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  freeRam=0;
 | 
					  freeRam=0;
 | 
				
			||||||
  char helpBuf[64];
 | 
					  char helpBuf[64];
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@ -750,12 +755,10 @@ void Button_Stats(void)
 | 
				
			|||||||
        sprintf(helpBuf,"(%u b)",(unsigned int)freeRam);
 | 
					        sprintf(helpBuf,"(%u b)",(unsigned int)freeRam);
 | 
				
			||||||
    strncat(buffer,helpBuf,sizeof(char)*37);
 | 
					    strncat(buffer,helpBuf,sizeof(char)*37);
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
   Print_in_window(18,51,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					   Print_in_window(18,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
  // Display free RAM (generic)
 | 
					  // Display free RAM (generic)
 | 
				
			||||||
  Print_in_window(10,51,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  freeRam = Memory_free();
 | 
					  freeRam = Memory_free();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if(freeRam > (100ULL*1024*1024*1024))
 | 
					  if(freeRam > (100ULL*1024*1024*1024))
 | 
				
			||||||
@ -767,21 +770,22 @@ void Button_Stats(void)
 | 
				
			|||||||
  else
 | 
					  else
 | 
				
			||||||
        sprintf(buffer,"%u bytes",(unsigned int)freeRam);
 | 
					        sprintf(buffer,"%u bytes",(unsigned int)freeRam);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  Print_in_window(114,51,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(114,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  
 | 
					  y+=8;
 | 
				
			||||||
  // Used memory
 | 
					  // Used memory
 | 
				
			||||||
  Print_in_window(10,59,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(10,y,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
  if(Stats_pages_memory > (100LL*1024*1024*1024))
 | 
					  if(Stats_pages_memory > (100LL*1024*1024*1024))
 | 
				
			||||||
        sprintf(buffer,"%ld (%lld Gb)",Stats_pages_number, Stats_pages_memory/(1024*1024*1024));
 | 
					        sprintf(buffer,"%ld (%lld Gb)",Stats_pages_number, Stats_pages_memory/(1024*1024*1024));
 | 
				
			||||||
  else if(Stats_pages_memory > (100*1024*1024))
 | 
					  else if(Stats_pages_memory > (100*1024*1024))
 | 
				
			||||||
        sprintf(buffer,"%ld (%lld Mb)",Stats_pages_number, Stats_pages_memory/(1024*1024));
 | 
					        sprintf(buffer,"%ld (%lld Mb)",Stats_pages_number, Stats_pages_memory/(1024*1024));
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
        sprintf(buffer,"%ld (%lld Kb)",Stats_pages_number, Stats_pages_memory/1024);
 | 
					        sprintf(buffer,"%ld (%lld Kb)",Stats_pages_number, Stats_pages_memory/1024);
 | 
				
			||||||
  Print_in_window(162,59,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(162,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  y+=8;
 | 
				
			||||||
#if defined(__WIN32__)
 | 
					#if defined(__WIN32__)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      ULARGE_INTEGER tailleU;
 | 
					      ULARGE_INTEGER tailleU;
 | 
				
			||||||
@ -826,7 +830,7 @@ void Button_Stats(void)
 | 
				
			|||||||
#else
 | 
					#else
 | 
				
			||||||
    sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
 | 
					    sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black);
 | 
					    Print_in_window(10,y,buffer,STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(mem_size > (100ULL*1024*1024*1024))
 | 
					    if(mem_size > (100ULL*1024*1024*1024))
 | 
				
			||||||
        sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024)));
 | 
					        sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024)));
 | 
				
			||||||
@ -837,35 +841,39 @@ void Button_Stats(void)
 | 
				
			|||||||
    else 
 | 
					    else 
 | 
				
			||||||
        sprintf(buffer,"%u bytes",(unsigned int)mem_size);
 | 
					        sprintf(buffer,"%u bytes",(unsigned int)mem_size);
 | 
				
			||||||
#if defined(__AROS__)
 | 
					#if defined(__AROS__)
 | 
				
			||||||
    Print_in_window(192,67,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					    Print_in_window(192,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    Print_in_window(146,67,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					    Print_in_window(146,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
	#ifndef NODISKSPACESUPPORT
 | 
						#ifndef NODISKSPACESUPPORT
 | 
				
			||||||
	  Print_in_window(10,67,"Disk full!",STATS_TITLE_COLOR,MC_Black);
 | 
						  Print_in_window(10,y,"Disk full!",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
	#endif
 | 
						#endif
 | 
				
			||||||
	#undef NODISKSPACESUPPORT
 | 
						#undef NODISKSPACESUPPORT
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  y+=16;
 | 
				
			||||||
  // Affichage des informations sur l'image
 | 
					  // Affichage des informations sur l'image
 | 
				
			||||||
  Print_in_window(10,83,"Picture info.:",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(10,y,"Picture info.:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  y+=8;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Affichage des dimensions de l'image
 | 
					  // Affichage des dimensions de l'image
 | 
				
			||||||
  Print_in_window(18,91,"Dimensions :",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(18,y,"Dimensions :",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
  sprintf(buffer,"%dx%d",Main_image_width,Main_image_height);
 | 
					  sprintf(buffer,"%dx%d",Main_image_width,Main_image_height);
 | 
				
			||||||
  Print_in_window(122,91,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(122,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  y+=8;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Affichage du nombre de couleur utilisé
 | 
					  // Affichage du nombre de couleur utilisé
 | 
				
			||||||
  Print_in_window(18,99,"Colors used:",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(18,y,"Colors used:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
  memset(color_usage,0,sizeof(color_usage));
 | 
					  memset(color_usage,0,sizeof(color_usage));
 | 
				
			||||||
  sprintf(buffer,"%d",Count_used_colors(color_usage));
 | 
					  sprintf(buffer,"%d",Count_used_colors(color_usage));
 | 
				
			||||||
  Print_in_window(122,99,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(122,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
 | 
					  y+=16;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Affichage des dimensions de l'écran
 | 
					  // Affichage des dimensions de l'écran
 | 
				
			||||||
  Print_in_window(10,115,"Resolution:",STATS_TITLE_COLOR,MC_Black);
 | 
					  Print_in_window(10,y,"Resolution:",STATS_TITLE_COLOR,MC_Black);
 | 
				
			||||||
  sprintf(buffer,"%dx%d",Screen_width,Screen_height);
 | 
					  sprintf(buffer,"%dx%d",Screen_width,Screen_height);
 | 
				
			||||||
  Print_in_window(106,115,buffer,STATS_DATA_COLOR,MC_Black);
 | 
					  Print_in_window(106,y,buffer,STATS_DATA_COLOR,MC_Black);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*310,Menu_factor_Y*174);
 | 
					  Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*310,Menu_factor_Y*174);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user