Fix line endings

This commit is contained in:
2025-05-14 09:39:09 -05:00
parent fe0270d2b6
commit 8555d53110
95 changed files with 61688 additions and 95 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,47 @@
void cd_init_dialogs();
void cd_init_dialogs();
short cd_create_dialog_parent_num(short dlog_num,short parent);
short cd_create_dialog(short dlog_num,WindowPtr parent);
void process_new_window (WindowPtr hDlg);
void cd_set_edit_focus();
short cd_kill_dialog(short dlog_num,short parent_message);
short cd_process_click(WindowPtr window,Point the_point, short mods,short *item);
short cd_process_keystroke(WindowPtr window,char char_hit,short *item);
void cd_init_button(short dlog_num,short item_num, short button_num, short status);
void cd_attach_key(short dlog_num,short item_num,char key);
void csp(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);
short cd_get_active(short dlog_num, short item_num);
void cd_get_item_text(short dlog_num, short item_num, char *str);
void csit(short dlog_num, short item_num, char *str);
void cd_retrieve_text_edit_str(short dlog_num, char *str);
void cd_set_text_edit_str(short dlog_num, char *str);
void cd_set_item_text(short dlog_num, short item_num, char *str);
void cdsin(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_flag(short dlog_num,short item_num,short flag);
short cd_get_led(short dlog_num,short item_num);
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_take_label(short dlog_num, short item_num);
void cd_key_label(short dlog_num, short item_num,short loc);
void cd_draw_item(short dlog_num,short item_num);
void cd_initial_draw(short dlog_num);
void cd_draw(short dlog_num);
void cd_redraw(WindowPtr window);
void cd_frame_item(short dlog_num, short item_num, short width);
void cd_erase_item(short dlog_num, short item_num);
void cd_erase_rect(short dlog_num,Rect to_fry);
void cd_press_button(short dlog_num, short item_num);
short cd_get_indices(short dlg_num, short item_num, short *dlg_index, short *item_index);
short cd_get_dlg_index(short dlog_num);
short cd_find_dlog(WindowPtr window, short *dlg_num, short *dlg_key);
short cd_get_item_id(short dlg_num, short item_num);
void center_window(WindowPtr window);
Rect get_item_rect(WindowPtr hDlg, short item_num);
void frame_dlog_rect(GrafPtr hDlg, Rect rect, short val);
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, Boolean do_frame,short win_or_gworld);
Rect calc_rect(short i, short j);
void beep() ;

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,23 @@
Boolean handle_action(EventRecord event,short mode);
Boolean handle_action(EventRecord event,short mode);
void flash_rect(Rect to_flash);
void edit_gold_or_food_event_filter (short item_hit);
void edit_gold_or_food(short which_to_edit);
void put_pc_graphics();
Boolean display_pc_event_filter (short item_hit);
void display_pc(short pc_num,short mode,short parent);
Boolean display_alchemy_event_filter (short item_hit);
void display_alchemy();
void do_xp_keep(short pc_num,short mode);
void draw_xp_skills();
void do_xp_draw();
Boolean spend_xp_event_filter (short item_hit);
void update_gold_skills();
Boolean spend_xp(short pc_num, short mode, short parent);
void give_reg_info_event_filter (short item_hit);
void give_reg_info();
void do_registration_event_filter (short item_hit);
void do_registration();
void edit_day();
void edit_day_event_filter (short item_hit);
void edit_xp_event_filter (short item_hit);
void edit_xp(pc_record_type *pc);

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,22 @@
Boolean give_to_pc(short pc_num,item_record_type item, short print_result);
Boolean give_to_pc(short pc_num,item_record_type item, short print_result);
Boolean give_to_party(item_record_type item,short print_result);
void give_gold(short amount,Boolean print_result);
Boolean take_gold(short amount,Boolean print_result);
short pc_has_space(short pc_num);
void take_item(short pc_num,short which_item);
void fancy_choice_dialog_event_filter (short item_hit);
short fancy_choice_dialog(short which_dlog,short parent);
void select_pc_event_filter (short item_hit);
short char_select_pc(short active_only,short free_inv_only,char *title);
short select_pc(short active_only,short free_inv_only);
short choice_dialog(short pic,short num);
Boolean give_spec_items_event_filter (short item_hit);
void give_spec_items();
short party_total_level();
short luck_total();
void display_traits_graphics();
void pick_race_abil_event_filter(short item_hit);
void pick_race_abil(pc_record_type *pc,short mode,short parent_num);
short get_tnl(pc_record_type *pc);
void reset_boats();
void combine_things(short pc_num);

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,9 @@
void save_file(short mode);
void save_file(short mode);
void load_file();
void leave_town();
long do_waterfall(long flag);
long init_data(long flag);
long open_pref_file();
void make_pref_file(FSSpec pref);
void save_prefs();
void remove_party_from_scen();

View File

@@ -1 +1,84 @@
#include <OSUtils.h>
#include <OSUtils.h>
#include "ed.global.h"
#include "math.h"
extern short give_delays;
short get_ran (short times,short min,short max)
{
long int store;
short i, to_ret = 0;
for (i = 1; i < times + 1; i++) {
store = Random();
to_ret = to_ret + min + (((store + 32767) * (max - min + 1)) / 65536);
}
return to_ret;
}
Boolean same_point(location p1,location p2)
{
if ((p1.x == p2.x) & (p1.y == p2.y))
return TRUE;
else return FALSE;
}
short move_to_zero(short val)
{
if (val < 0)
return val + 1;
if (val > 0)
return val - 1;
return val;
}
short max(short a,short b)
{
if (a > b)
return a;
else return b;
}
short min(short a,short b)
{
if (a < b)
return a;
else return b;
}
short minmax(short min,short max,short k)
{
if (k < min)
return min;
if (k > max)
return max;
return k;
}
short s_pow(short x,short y)
{
return (short) pow((double) x, (double) y);
}
short a_v(short x)
{
if (x < 0)
return (-1 * x);
else return x;
}
short ex_abs(short x)
{
if (x < 0)
return (-1 * x);
else return x;
}
void pause(short length)
{
long dummy,len;
len = (long) length;
if (give_delays == 0)
Delay(len, &dummy);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,22 @@
void init_main_buttons();
void init_main_buttons();
void Set_up_win ();
void redraw_screen();
void draw_main_screen();
void do_button_action(short which_pc,short which_button);
GWorldPtr load_pict(short picture_to_get);
void draw_items(short clear_first);
void display_party(short mode,short clear_first);
void undo_clip();
void add_string_to_buf(char *str) ;
void rect_draw_some_item (GWorldPtr src_gworld, Rect src_rect, GWorldPtr targ_gworld,Rect targ_rect,
char masked,short main_win);
void char_win_draw_string(GrafPtr dest_window,Rect dest_rect,char *str,short mode,short line_height);
void win_draw_string(GrafPtr dest_window,Rect dest_rect,Str255 str,short mode,short line_height);
void display_strings_event_filter (short item_hit);
void display_strings(short str1a,short str1b,short str2a,short str2b,
char *title,short sound_num,short graphic_num,short parent_num);
void c2p(Str255 str) ;
void p2c(Str255 str);
void get_str(Str255 str,short i, short j);
short string_length(char *str);
void make_cursor_sword();

View File

@@ -1 +1,174 @@
#include "math.h"
#include "math.h"
#include <Sound.h>
#include <Memory.h>
#include <OSUtils.h>
#include "ed.sound.h"
#include "ed.global.h"
#define NUM_SOUNDS 69
Handle sound_handles[NUM_SOUNDS];
extern Boolean play_sounds,in_startup_mode;
extern WindowPtr mainPtr;
extern Boolean gInBackground;
extern party_record_type party;
short last_played = 10000;
Boolean always_asynch[70] = {FALSE,FALSE,FALSE,FALSE,FALSE,
FALSE,TRUE,FALSE,FALSE,FALSE,
FALSE,FALSE,FALSE,FALSE,FALSE,
FALSE,FALSE,FALSE,FALSE,FALSE,
FALSE,FALSE,TRUE,FALSE,TRUE,
TRUE,FALSE,FALSE,FALSE,FALSE,
FALSE,FALSE,FALSE,FALSE,TRUE,
FALSE,FALSE,TRUE,FALSE,TRUE,
FALSE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE,
TRUE,FALSE,FALSE,FALSE,FALSE,
TRUE,FALSE,FALSE,FALSE,FALSE,
FALSE,TRUE,FALSE,FALSE,FALSE,
FALSE,FALSE,FALSE,FALSE,FALSE};
Boolean load_when_play[70] = {FALSE,FALSE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE, // 10
FALSE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE, // 20
TRUE,TRUE,TRUE,TRUE,FALSE,
FALSE,FALSE,FALSE,FALSE,FALSE, // 30
TRUE,TRUE,FALSE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,FALSE,FALSE,FALSE,
FALSE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE,
TRUE,TRUE,TRUE,TRUE,TRUE, // 60
TRUE,TRUE,TRUE,TRUE,TRUE
};
short sound_delay[70] = {0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,25,25,0,0,0,0,
0,0,0,0,8,0,0,8,0,0,
0,0,0,10,20,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,13,0,0,0,0,0,0,0,0};
//Allocate SndChannelPtr chan[4] as a global variable.
//Allocate char numchannel = 3; (This gives 4 channels, = 2 gives 3 etc...
//Allocate char channel; This is just used as a counter so each sound is played by the next
//channel in line. You can have up to 4 sounds playing at once.
SndChannelPtr chan[4];
char numchannel = 3;
char channel;
void load_sounds ()
{
short i,t;
for (i = 0; i < NUM_SOUNDS; i++) {
load_when_play[i] = TRUE;
always_asynch[i] = FALSE;
if (load_when_play[i] == FALSE) {
sound_handles[i] = GetResource('snd ', 20000 + i);
}
}
for(t=0;t<4;t++)/****** setup 4 sound channels **********/
{
SndNewChannel(&chan[t], sampledSynth, initMono + initNoDrop, NIL);
chan[t]->qLength = 128;
}
}
void play_sound(short which) // if < 0, play asynch
{
// if (play_sounds == TRUE)
force_play_sound(which);
}
/*
sound(id)
int id;
{
Boolean secondtry = FALSE;
channel++;
if (channel > numchannel) channel = 0;
sndhandle = NIL;
sndhandle = GetResource('snd ',abs(id));
if (sndhandle != NIL)
{
HLock(sndhandle);
HNoPurge(sndhandle);
if (id > 0) SndPlay(chan[channel],sndhandle,TRUE);/****** Normal SndPlay *****/
/* else SndPlay(chan[channel],sndhandle,FALSE);/****** play ASYNC *****/
/* }
}
*/
void force_play_sound(short which)
{
Handle sndhandle;
long dummy;
OSErr err;
// if (play_sounds == TRUE)
// SndPlay(NIL, sound_handles[which], TRUE);
// if (play_sounds == TRUE) {
channel++;
if (channel > numchannel) channel = 0;
if (load_when_play[((which < 0) ? -1 * which : which)] == TRUE)
sndhandle = GetResource('snd ',20000 + ((which < 0) ? -1 * which : which));
else sndhandle = sound_handles[((which < 0) ? -1 * which : which)];
if (which > 0)
if (always_asynch[which] == TRUE)
which = which * -1;
if (sndhandle != NIL)
{
HLock(sndhandle);
if (which < 0) err = SndPlay(chan[channel],(SndListHandle) sndhandle,TRUE);/****** Normal SndPlay *****/
else {
err = SndPlay(chan[channel],(SndListHandle) sndhandle,FALSE);
}
if (err != 0) {
}
HUnlock(sndhandle);
}
else SysBeep(2);
if (which < 0)
Delay(sound_delay[-1 * which],&dummy);
// }
}
void one_sound(short which)
{
if (which == last_played)
return;
play_sound(which);
last_played = which;
}
void clear_sound_memory()
{
last_played = 100;
}
void flip_sound()
{
play_sounds = (play_sounds == TRUE) ? FALSE : TRUE;
}

View File

@@ -1 +1,6 @@
void load_sounds ();
void load_sounds ();
void play_sound(short which) ; // if < 0, play asynch
void force_play_sound(short which);
void one_sound(short which);
void clear_sound_memory();
void flip_sound();

File diff suppressed because one or more lines are too long