ClearEntities();
}
-DEntity* DMap::AddEntity( char *classname, int ID ){
+DEntity* DMap::AddEntity( const char *classname, int ID ){
DEntity* newEntity;
if ( ID == -1 ) {
newEntity = new DEntity( classname, m_nNextEntity++ );
void ClearEntities();
DEntity* GetEntityForID( int ID );
-DEntity* AddEntity( char* classname = "worldspawn", int ID = -1 );
+DEntity* AddEntity( const char* classname = "worldspawn", int ID = -1 );
std::list<DEntity*> entityList;
}
// plugin name
-char* PLUGIN_NAME = "bobToolz";
+const char* PLUGIN_NAME = "bobToolz";
// commands in the menu
-static char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Split patches cols,Split patches rows,Turn edge";
+static const char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Split patches cols,Split patches rows,Turn edge";
// globals
ui::Widget g_pRadiantWnd;
Data validation Routines
---------------------------------*/
-bool ValidateTextFloat( const char* pData, char* error_title, float* value ){
+bool ValidateTextFloat( const char* pData, const char* error_title, float* value ){
if ( pData ) {
float testNum = (float)atof( pData );
return FALSE;
}
-bool ValidateTextFloatRange( const char* pData, float min, float max, char* error_title, float* value ){
+bool ValidateTextFloatRange( const char* pData, float min, float max, const char* error_title, float* value ){
char error_buffer[256];
sprintf( error_buffer, "Please Enter A Floating Point Number Between %.3f and %.3f", min, max );
return FALSE;
}
-bool ValidateTextIntRange( const char* pData, int min, int max, char* error_title, int* value ){
+bool ValidateTextIntRange( const char* pData, int min, int max, const char* error_title, int* value ){
char error_buffer[256];
sprintf( error_buffer, "Please Enter An Integer Between %i and %i", min, max );
return FALSE;
}
-bool ValidateTextInt( const char* pData, char* error_title, int* value ){
+bool ValidateTextInt( const char* pData, const char* error_title, int* value ){
if ( pData ) {
int testNum = atoi( pData );
EMessageBoxReturn ret;
int loop = 1;
- char *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
+ const char *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
auto window = ui::Window( ui::window_type::TOP );
EMessageBoxReturn ret;
int loop = 1;
- char const *text = "Please set a value in the boxes below and press 'OK' to make a chain";
+ const char *text = "Please set a value in the boxes below and press 'OK' to make a chain";
auto window = ui::Window( ui::window_type::TOP );
#define CONFIG_SECTION "Configuration"
-int INIGetInt( char *key, int def ){
+int INIGetInt( const char *key, int def ){
char value[1024];
if ( read_var( INIfn.c_str(), CONFIG_SECTION, key, value ) ) {
}
}
-void INISetInt( char *key, int val, char *comment /* = NULL */ ){
+void INISetInt( const char *key, int val, const char *comment /* = NULL */ ){
char s[1000];
if ( comment ) {
void InitInstance();
void SaveConfig();
-int INIGetInt( char *key, int def );
-void INISetInt( char *key, int val, char *comment = 0 );
+int INIGetInt( const char *key, int def );
+void INISetInt( const char *key, int val, const char *comment = 0 );
#define IDOK 1
#define IDCANCEL 2
typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
-void GetTextures( char* extension ){
+void GetTextures( const char* extension ){
GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 );
}
/**
* @brief Some default values to worldspawn like maxlevel and so on
*/
-void assign_default_values_to_worldspawn( bool override, char **returnMsg ){
+void assign_default_values_to_worldspawn( bool override, const char **returnMsg ){
static char message[1024];
Entity* worldspawn;
int teams = 0;
* @brief Will check e.g. the map entities for valid values
* @todo: check for maxlevel
*/
-void check_map_values( char **returnMsg ){
+void check_map_values( const char **returnMsg ){
static char message[1024];
int count = 0;
int teams = 0;
FIXME: make this buffer size safe someday
============
*/
-char * QDECL va( char *format, ... ) {
+char *QDECL va( const char *format, ... ) {
va_list argptr;
static char string[2][32000]; // in case va is called by nested functions
static int index = 0;
FIXME: overflow check?
===============
*/
-char *Info_ValueForKey( const char *s, const char *key ) {
+const char *Info_ValueForKey( const char *s, const char *key ) {
char pkey[MAX_INFO_KEY];
static char value[2][MAX_INFO_VALUE]; // use two buffers so compares
// work without stomping on each other
float LittleFloat( float l );
void Swap_Init( void );
-char * QDECL va( char *format, ... );
+char *QDECL va( const char *format, ... );
#ifdef __cplusplus
}
//
// key / value info strings
//
-char *Info_ValueForKey( const char *s, const char *key );
+const char *Info_ValueForKey( const char *s, const char *key );
void Info_RemoveKey( char *s, const char *key );
void Info_SetValueForKey( char *s, const char *key, const char *value );
qboolean Info_Validate( const char *s );
// =============================================================================
// Add new shader tag dialog
-EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, char* title ){
+EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
ModalDialog dialog;
GtkEntry* textentry;
ModalDialogButton ok_button( dialog, eIDOK );
return ret;
}
-EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* title ){
+EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title ){
ModalDialog dialog;
ModalDialogButton ok_button( dialog, eIDOK );
#include "string/string.h"
EMessageBoxReturn DoLightIntensityDlg( int *intensity );
-EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, char* title );
-EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* title );
+EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, const char* title );
+EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title );
EMessageBoxReturn DoTextureLayout( float *fx, float *fy );
void DoTextEditor( const char* filename, int cursorpos );