- Renamed all source files for better consistency and for a cpp extension.
- Added Bandit Busywork and the GPL license. git-svn-id: http://openexile.googlecode.com/svn/trunk@23 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -1,174 +0,0 @@
|
||||
#include "math.h"
|
||||
|
||||
#include <ed.Sound.h>
|
||||
#include <Memory.h>
|
||||
//#include <OSUtils.h>
|
||||
#include <Carbon/Carbon.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;
|
||||
unsigned 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;
|
||||
}
|
||||
|
@@ -1,6 +0,0 @@
|
||||
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();
|
@@ -1 +0,0 @@
|
||||
item_record_type item_list[400];
|
@@ -1,18 +1,10 @@
|
||||
//#include <Windows.h>
|
||||
//#include <Dialogs.h>
|
||||
//#include <TextUtils.h>
|
||||
#include <stdio.h>
|
||||
//#include <OSUtils.h>
|
||||
//#include <Quickdraw.h>
|
||||
//#include <QDOffscreen.h>
|
||||
|
||||
#include <Carbon/Carbon.h> /*jmr*/
|
||||
|
||||
#include "ed.graphics.h"
|
||||
#include "ed.global.h"
|
||||
#include "ed.editors.h"
|
||||
#include "ed.fileio.h"
|
||||
#include "ed.action.h"
|
||||
#include "pc.graphics.h"
|
||||
#include "pc.global.h"
|
||||
#include "pc.editors.h"
|
||||
#include "pc.fileio.h"
|
||||
#include "pc.action.h"
|
||||
#include "graphtool.h"
|
||||
#include "soundtool.h"
|
||||
#include "dlgtool.h"
|
@@ -1,13 +1,7 @@
|
||||
//#include <Quickdraw.h>
|
||||
//#include <Dialogs.h>
|
||||
//#include <Palettes.h>
|
||||
//#include <QDOffscreen.h>
|
||||
|
||||
#include <Carbon/Carbon.h> /*jmr*/
|
||||
|
||||
#include "ed.graphics.h"
|
||||
#include "ed.global.h"
|
||||
#include "ed.editors.h"
|
||||
#include "pc.graphics.h"
|
||||
#include "pc.global.h"
|
||||
#include "pc.editors.h"
|
||||
#include "graphtool.h"
|
||||
#include "dlgtool.h"
|
||||
|
@@ -1,23 +1,13 @@
|
||||
#include <Memory.h>
|
||||
//#include <Menus.h>
|
||||
//#include <Windows.h>
|
||||
//#include <TextEdit.h>
|
||||
//#include <Dialogs.h>
|
||||
//#include <ToolUtils.h>
|
||||
//#include <Files.h>
|
||||
//#include <StandardFile.h>
|
||||
//#include <Resources.h>
|
||||
//#include <QDOffscreen.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
//#inculde <Memory.h>
|
||||
#include <string.h>
|
||||
#include "stdio.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ed.global.h"
|
||||
#include "ed.fileio.h"
|
||||
#include "ed.graphics.h"
|
||||
#include "pc.global.h"
|
||||
#include "pc.fileio.h"
|
||||
#include "pc.graphics.h"
|
||||
#include "graphtool.h"
|
||||
#include "soundtool.h"
|
||||
#include "ed.editors.h"
|
||||
#include "pc.editors.h"
|
||||
#include "mathutil.h"
|
||||
|
||||
#define DONE_BUTTON_ITEM 1
|
@@ -1,22 +1,10 @@
|
||||
#include <Memory.h>
|
||||
//#include <Quickdraw.h>
|
||||
//#include <Fonts.h>
|
||||
//#include <Events.h>
|
||||
//#include <Menus.h>
|
||||
//#include <Windows.h>
|
||||
//#include <TextEdit.h>
|
||||
//#include <Dialogs.h>
|
||||
//#include <Resources.h>
|
||||
//#include <OSUtils.h>
|
||||
//#include <ToolUtils.h>
|
||||
//#include <QDOffscreen.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "ed.global.h"
|
||||
#include "ed.graphics.h"
|
||||
#include "ed.editors.h"
|
||||
#include "ed.action.h"
|
||||
//#include <Memory.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "pc.global.h"
|
||||
#include "pc.graphics.h"
|
||||
#include "pc.editors.h"
|
||||
#include "pc.action.h"
|
||||
#include "soundtool.h"
|
||||
#include "graphtool.h"
|
||||
#include "dlgtool.h"
|
||||
@@ -340,7 +328,7 @@ void draw_main_screen()
|
||||
TextFace(0); // reset text pen
|
||||
TextFace(bold);
|
||||
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,1); // draw the frame
|
||||
//i = pc_info_rect.left-pc_info_rect.right;
|
||||
//sprintf((char *)temp_str,"Width of pc_info_rect %d ",
|
||||
//(short) i);
|
||||
@@ -479,9 +467,9 @@ void draw_items(short clear_first)
|
||||
//TextSize(10);
|
||||
|
||||
if (adven[current_active_pc].main_status != 1){
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,0); // re draw entire frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),info_area_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_race_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,1); // re draw entire frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),info_area_rect,1); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_race_rect,1); // draw the frame
|
||||
return; // If PC is dead, it has no items
|
||||
}
|
||||
for (i = 0; i < 24; i++) // Loop through items and draw each
|
||||
@@ -506,10 +494,10 @@ void draw_items(short clear_first)
|
||||
rect_draw_some_item(mixed_gworld,d_from,mixed_gworld,item_string_rects[i][1],1,1);
|
||||
rect_draw_some_item(mixed_gworld,i_from,mixed_gworld,item_string_rects[i][2],1,1);
|
||||
}
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,0); // re draw entire frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),name_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_race_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),info_area_rect,0); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,1); // re draw entire frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),name_rect,1); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_race_rect,1); // draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),info_area_rect,1); // draw the frame
|
||||
|
||||
}
|
||||
|
||||
@@ -532,7 +520,7 @@ void display_party(short mode,short clear_first)
|
||||
FillCRect(&name_rect,bg[12]);
|
||||
FillCRect(&pc_race_rect,bg[12]);
|
||||
FillCRect(&info_area_rect,bg[12]);
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,0); // re-draw the frame
|
||||
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,1); // re-draw the frame
|
||||
}
|
||||
|
||||
if (file_in_mem == FALSE) { // what if no party loaded?
|
@@ -1,32 +1,12 @@
|
||||
|
||||
#include <Memory.h>
|
||||
//#include <Quickdraw.h>
|
||||
//#include <QuickdrawText.h>
|
||||
|
||||
//#include <Fonts.h>
|
||||
//#include <Events.h>
|
||||
//#include <Menus.h>
|
||||
//#include <Windows.h>
|
||||
//#include <TextEdit.h>
|
||||
//#include <Dialogs.h>
|
||||
//#include <OSUtils.h>
|
||||
//#include <ToolUtils.h>
|
||||
//#include <Memory.h>
|
||||
#include <stdio.h>
|
||||
//#include <Gestalt.h>
|
||||
//#include <Palettes.h>
|
||||
//#include <AppleEvents.h>
|
||||
//#include <Files.h>
|
||||
//#include <StandardFile.h>
|
||||
//#include <QDOffscreen.h>
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#include "string.h"
|
||||
#include "ed.global.h"
|
||||
#include "ed.graphics.h"
|
||||
#include "ed.editors.h"
|
||||
#include "ed.action.h"
|
||||
#include "ed.fileio.h"
|
||||
#include <string.h>
|
||||
#include "pc.global.h"
|
||||
#include "pc.graphics.h"
|
||||
#include "pc.editors.h"
|
||||
#include "pc.action.h"
|
||||
#include "pc.fileio.h"
|
||||
#include "soundtool.h"
|
||||
#include "dlgtool.h"
|
||||
#include "dlgconsts.h"
|
||||
@@ -132,7 +112,8 @@ short specials_res_id;
|
||||
Str255 start_name;
|
||||
ResFileRefNum graphicsRef, soundRef, mainRef;
|
||||
|
||||
#include "item_data.h"
|
||||
//#include "pc.itemdata.h"
|
||||
item_record_type item_list[400];
|
||||
|
||||
//
|
||||
// Main body of program Exile
|
Reference in New Issue
Block a user