CharEd: make strings const
This commit is contained in:
@@ -102,7 +102,7 @@ short button_type[150] = {1,1,4,5,1,1,0,0,1,1,
|
|||||||
2,2,2,2,2,2,2,2,1,1,
|
2,2,2,2,2,2,2,2,1,1,
|
||||||
1,1,1,1,1,1,1,1,0,0,
|
1,1,1,1,1,1,1,1,0,0,
|
||||||
0,0,0,0,0,0,0,0,0,0};
|
0,0,0,0,0,0,0,0,0,0};
|
||||||
char *button_strs[150] = {"Done ","Ask"," "," ","Keep", "Cancel","+","-","Buy","Leave",
|
char const *button_strs[150] = {"Done ","Ask"," "," ","Keep", "Cancel","+","-","Buy","Leave",
|
||||||
"Get","1","2","3","4","5","6","Cast"," "," ",
|
"Get","1","2","3","4","5","6","Cast"," "," ",
|
||||||
" "," "," ","Buy","Sell","Other Spells","Buy x10"," "," ","Save",
|
" "," "," ","Buy","Sell","Other Spells","Buy x10"," "," ","Save",
|
||||||
"Race","Train","Items","Spells","Heal Party","1","2","3","4","5",
|
"Race","Train","Items","Spells","Heal Party","1","2","3","4","5",
|
||||||
@@ -747,7 +747,7 @@ void cd_get_text_edit_str(short, char *str)
|
|||||||
else str[0] = 0;
|
else str[0] = 0;
|
||||||
}
|
}
|
||||||
// NOTE!!! Expects a c string
|
// NOTE!!! Expects a c string
|
||||||
void cd_set_text_edit_str(short, char *str)
|
void cd_set_text_edit_str(short, char const *str)
|
||||||
{
|
{
|
||||||
if (edit_box != NULL)
|
if (edit_box != NULL)
|
||||||
SetWindowText(edit_box,str);
|
SetWindowText(edit_box,str);
|
||||||
@@ -756,7 +756,7 @@ void cdsin(short dlog_num, short item_num, short num)
|
|||||||
{
|
{
|
||||||
cd_set_item_num( dlog_num, item_num, num);
|
cd_set_item_num( dlog_num, item_num, num);
|
||||||
}
|
}
|
||||||
void csit(short dlog_num, short item_num, char *str)
|
void csit(short dlog_num, short item_num, char const *str)
|
||||||
{
|
{
|
||||||
cd_set_item_text( dlog_num, item_num, str);
|
cd_set_item_text( dlog_num, item_num, str);
|
||||||
}
|
}
|
||||||
@@ -766,7 +766,7 @@ void csp(short dlog_num, short item_num, short pict_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cd_set_item_text(short dlog_num, short item_num, char *str)
|
void cd_set_item_text(short dlog_num, short item_num, char const *str)
|
||||||
{
|
{
|
||||||
short k,dlg_index,item_index;
|
short k,dlg_index,item_index;
|
||||||
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
|
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
|
||||||
@@ -865,7 +865,7 @@ void cd_text_frame(short dlog_num,short item_num,short frame)
|
|||||||
cd_draw_item(dlog_num,item_num);
|
cd_draw_item(dlog_num,item_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cd_add_label(short dlog_num, short item_num, char *label, short label_flag)
|
void cd_add_label(short dlog_num, short item_num, char const *label, short label_flag)
|
||||||
{
|
{
|
||||||
short dlg_index,item_index,label_loc = -1;
|
short dlg_index,item_index,label_loc = -1;
|
||||||
short i;
|
short i;
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ void cd_init_button(short dlog_num,short item_num, short button_num, short statu
|
|||||||
void cd_attach_key(short dlog_num,short item_num,char key);
|
void cd_attach_key(short dlog_num,short item_num,char key);
|
||||||
void cd_set_pict(short dlog_num, short item_num, short pict_num);
|
void cd_set_pict(short dlog_num, short item_num, short pict_num);
|
||||||
void cd_activate_item(short dlog_num, short item_num, short status);
|
void cd_activate_item(short dlog_num, short item_num, short status);
|
||||||
void cd_get_item_text(short dlog_num, short item_num, char *str);
|
void cd_get_item_text(short dlog_num, short item_num, char const *str);
|
||||||
void cd_set_item_text(short dlog_num, short item_num, char *str);
|
void cd_set_item_text(short dlog_num, short item_num, char const *str);
|
||||||
void cd_set_item_num(short dlog_num, short item_num, short num);
|
void cd_set_item_num(short dlog_num, short item_num, short num);
|
||||||
void cd_set_led(short dlog_num,short item_num,short state);
|
void cd_set_led(short dlog_num,short item_num,short state);
|
||||||
void cd_text_frame(short dlog_num,short item_num,short frame);
|
void cd_text_frame(short dlog_num,short item_num,short frame);
|
||||||
void cd_add_label(short dlog_num, short item_num, char *label, short label_flag);
|
void cd_add_label(short dlog_num, short item_num, char const *label, short label_flag);
|
||||||
void cd_take_label(short dlog_num, short item_num);
|
void cd_take_label(short dlog_num, short item_num);
|
||||||
void cd_key_label(short dlog_num, short item_num,short loc);
|
void cd_key_label(short dlog_num, short item_num,short loc);
|
||||||
void cd_draw_item(short dlog_num,short item_num);
|
void cd_draw_item(short dlog_num,short item_num);
|
||||||
@@ -43,9 +43,9 @@ void draw_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,s
|
|||||||
void showcursor(Boolean a);
|
void showcursor(Boolean a);
|
||||||
|
|
||||||
void cd_get_text_edit_str(short dlog_num, char *str);
|
void cd_get_text_edit_str(short dlog_num, char *str);
|
||||||
void cd_set_text_edit_str(short dlog_num, char *str);
|
void cd_set_text_edit_str(short dlog_num, char const *str);
|
||||||
void cdsin(short dlog_num, short item_num, short num);
|
void cdsin(short dlog_num, short item_num, short num);
|
||||||
void csit(short dlog_num, short item_num, char *str);
|
void csit(short dlog_num, short item_num, char const *str);
|
||||||
void csp(short dlog_num, short item_num, short pict_num);
|
void csp(short dlog_num, short item_num, short pict_num);
|
||||||
void ModalDialog();
|
void ModalDialog();
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ Boolean display_alchemy_event_filter (short item_hit)
|
|||||||
void display_alchemy()
|
void display_alchemy()
|
||||||
{
|
{
|
||||||
short i;
|
short i;
|
||||||
char *alch_names[] = {"Weak Curing Potion (1)","Weak Healing Potion (1)","Weak Poison (1)",
|
char const *alch_names[] = {"Weak Curing Potion (1)","Weak Healing Potion (1)","Weak Poison (1)",
|
||||||
"Weak Speed Potion (3)","Medium Poison (3)",
|
"Weak Speed Potion (3)","Medium Poison (3)",
|
||||||
"Medium Heal Potion (4)","Strong Curing (5)","Medium Speed Potion (5)",
|
"Medium Heal Potion (4)","Strong Curing (5)","Medium Speed Potion (5)",
|
||||||
"Graymold Salve (7)","Weak Power Potion (9)",
|
"Graymold Salve (7)","Weak Power Potion (9)",
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ path[i+1]='\0'; // close the argument string after the last '\'
|
|||||||
|
|
||||||
void file_initialize()
|
void file_initialize()
|
||||||
{
|
{
|
||||||
static char * szFilter[] =
|
static char const * szFilter[] =
|
||||||
{
|
{
|
||||||
"Classic BoE Save Files (*.SAV)\0*.sav\0"
|
"Classic BoE Save Files (*.SAV)\0*.sav\0"
|
||||||
"Experimental BoE Save Files (*.savx)\0*.savx\0"
|
"Experimental BoE Save Files (*.savx)\0*.savx\0"
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ void select_pc_event_filter (short item_hit)
|
|||||||
else dialog_answer = item_hit - 3;
|
else dialog_answer = item_hit - 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
short char_select_pc(short active_only,short free_inv_only,char *title)
|
short char_select_pc(short active_only,short free_inv_only,char const *title)
|
||||||
//active_only; // 0 - no 1 - yes 2 - disarm trap
|
//active_only; // 0 - no 1 - yes 2 - disarm trap
|
||||||
{
|
{
|
||||||
short i;
|
short i;
|
||||||
@@ -365,8 +365,8 @@ void pick_race_abil_event_filter(short item_hit)
|
|||||||
void pick_race_abil(pc_record_type *pc,short mode,short parent_num)
|
void pick_race_abil(pc_record_type *pc,short mode,short parent_num)
|
||||||
//mode; // 0 - edit 1 - just display 2 - can't change race
|
//mode; // 0 - edit 1 - just display 2 - can't change race
|
||||||
{
|
{
|
||||||
char *start_str1 = "Click on advantage button for description.";
|
char const *start_str1 = "Click on advantage button for description.";
|
||||||
char *start_str2 = "Click on advantage button to add/lose.";
|
char const *start_str2 = "Click on advantage button to add/lose.";
|
||||||
|
|
||||||
|
|
||||||
mode = 0;
|
mode = 0;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ void take_item(short pc_num,short which_item);
|
|||||||
void fancy_choice_dialog_event_filter (short item_hit);
|
void fancy_choice_dialog_event_filter (short item_hit);
|
||||||
short fancy_choice_dialog(short which_dlog,short parent);
|
short fancy_choice_dialog(short which_dlog,short parent);
|
||||||
void select_pc_event_filter (short item_hit);
|
void select_pc_event_filter (short item_hit);
|
||||||
short char_select_pc(short active_only,short free_inv_only,char *title);
|
short char_select_pc(short active_only,short free_inv_only,char const *title);
|
||||||
short select_pc(short active_only,short free_inv_only);
|
short select_pc(short active_only,short free_inv_only);
|
||||||
short choice_dialog(short pic,short num);
|
short choice_dialog(short pic,short num);
|
||||||
Boolean give_spec_items_event_filter (short item_hit);
|
Boolean give_spec_items_event_filter (short item_hit);
|
||||||
|
|||||||
@@ -868,7 +868,7 @@ void display_strings_event_filter (short item_hit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void display_strings(short str1a,short str1b,short str2a,short str2b,
|
void display_strings(short str1a,short str1b,short str2a,short str2b,
|
||||||
char *title,short sound_num,short graphic_num,short parent_num)
|
char const *title,short sound_num,short graphic_num,short parent_num)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -918,7 +918,7 @@ void get_str(char *str,short i, short j)
|
|||||||
GetIndString(str, i, j);
|
GetIndString(str, i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void char_win_draw_string(HDC dest_window,RECT dest_rect,char *str,short mode,short line_height)
|
void char_win_draw_string(HDC dest_window,RECT dest_rect,char const *str,short mode,short line_height)
|
||||||
{
|
{
|
||||||
char store_s[256];
|
char store_s[256];
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ void draw_items(short clear_first);
|
|||||||
void display_party(short mode,short clear_first);
|
void display_party(short mode,short clear_first);
|
||||||
|
|
||||||
|
|
||||||
void char_win_draw_string(HDC dest_window,RECT dest_rect,char *str,short mode,short line_height);
|
void char_win_draw_string(HDC dest_window,RECT dest_rect,char const *str,short mode,short line_height);
|
||||||
void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short line_height);
|
void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short line_height);
|
||||||
void display_strings_event_filter (short item_hit);
|
void display_strings_event_filter (short item_hit);
|
||||||
void display_strings(short str1a,short str1b,short str2a,short str2b,
|
void display_strings(short str1a,short str1b,short str2a,short str2b,
|
||||||
char *title,short sound_num,short graphic_num,short parent_num);
|
char const *title,short sound_num,short graphic_num,short parent_num);
|
||||||
void c2p(char *str) ;
|
void c2p(char *str) ;
|
||||||
void p2c(char *str);
|
void p2c(char *str);
|
||||||
void get_str(char *,short i, short j);
|
void get_str(char *,short i, short j);
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ void paint_pattern(HBITMAP dest,short which_mode,RECT dest_rect,short which_patt
|
|||||||
|
|
||||||
/* GK */
|
/* GK */
|
||||||
|
|
||||||
HBITMAP ReadBMP(char * fileName)
|
HBITMAP ReadBMP(char const * fileName)
|
||||||
{
|
{
|
||||||
return (HBITMAP) LoadImage(0, fileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
|
return (HBITMAP) LoadImage(0, fileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ Boolean Button();
|
|||||||
void paint_pattern(HBITMAP dest,short which_mode,RECT dest_rect,short which_pattern);
|
void paint_pattern(HBITMAP dest,short which_mode,RECT dest_rect,short which_pattern);
|
||||||
|
|
||||||
/* GK */
|
/* GK */
|
||||||
HBITMAP ReadBMP(char * fileName);
|
HBITMAP ReadBMP(char const * fileName);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user