- Tidied scenario editor code – proper indentation applied, no more multiple statements on one line, etc

- Changed various terrain arrays from unsigned char to unsigned short to support more than 256 terrain types.

git-svn-id: http://openexile.googlecode.com/svn/trunk@42 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-04-28 16:45:32 +00:00
parent 049754ea27
commit 3efed5dcc7
17 changed files with 5219 additions and 5280 deletions

View File

@@ -3,20 +3,18 @@
#include "classes.h"
#include "scen.dlgutil.h"
DialogPtr make_dialog(int resource_num)
{
DialogPtr make_dialog(int resource_num) {
DialogPtr the_dialog;
the_dialog = GetNewDialog (resource_num, 0, IN_FRONT);
if (the_dialog == NULL)
SysBeep(50);
ShowWindow (GetDialogWindow(the_dialog));
return the_dialog;
}
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num)
{
void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num) {
Str255 text_entry;
short the_type;
Handle the_handle = NULL;
@@ -24,26 +22,25 @@ void put_num_in_text(short num_to_put,DialogPtr the_dialog, short item_num)
NumToString ((long) num_to_put , text_entry);
GetDialogItem( the_dialog, item_num, &the_type, &the_handle, &the_rect );
SetDialogItemText ( the_handle, text_entry);
SetDialogItemText ( the_handle, text_entry);
}
long get_text_item_num(short item_num,DialogPtr the_dialog)
{
long get_text_item_num(short item_num,DialogPtr the_dialog) {
long storage;
long number_given = 0;
short the_type;
Handle the_handle = NULL;
Rect the_rect;
Str255 the_string;
Str255 the_string;
GetDialogItem( the_dialog, item_num, &the_type, &the_handle, &the_rect );
GetDialogItemText ( the_handle, the_string);
StringToNum( the_string, &number_given);
StringToNum( the_string, &number_given);
storage = number_given;
return storage;
}