Bunch of small fixes emailed to me from phaethon

Kent
--
mein@cs.umn.edu
This commit is contained in:
Kent Mein
2002-11-29 17:07:58 +00:00
parent 3fe6959360
commit 651fa32eaa
5 changed files with 39 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ def makemakefile(outfp, makevars, files, target):
for key in keys: for key in keys:
outfp.write("%s=%s\n" % (key, makevars[key])) outfp.write("%s=%s\n" % (key, makevars[key]))
outfp.write("\n\ninclude nan_definitions.mk\n") # outfp.write("\n\ninclude nan_definitions.mk\n")
outfp.write("\nall: %s\n\n" % libtarget) outfp.write("\nall: %s\n\n" % libtarget)
deps = [] deps = []
@@ -50,8 +50,9 @@ def makemakefile(outfp, makevars, files, target):
# libfiles.remove('M___main__.o') # don't link with __main__ # libfiles.remove('M___main__.o') # don't link with __main__
outfp.write("\n%s: $(OBJS)\n" % (libtarget)) outfp.write("\n%s: $(OBJS)\n" % (libtarget))
outfp.write("\t$(AR) ruv %s%s $(OBJS)\n" % # outfp.write("\t$(AR) ruv %s%s $(OBJS)\n" %
("$(OCGDIR)/blender/bpython/$(DEBUG_DIR)", targetlib)) # ("$(OCGDIR)/blender/bpython/$(DEBUG_DIR)", targetlib))
outfp.write("\t$(AR) ruv %s $(OBJS)\n" % targetlib)
outfp.write("\n%s: %s $(OBJS)\n" % (target, mainfile)) outfp.write("\n%s: %s $(OBJS)\n" % (target, mainfile))
outfp.write("\t$(CC) %s %s -o %s $(LDLAST)\n" % outfp.write("\t$(CC) %s %s -o %s $(LDLAST)\n" %

View File

@@ -76,9 +76,11 @@ MODNAME(BLENDERMODULE) -> "_Blender"
#define MODNAME(x) _MODNAME(x) #define MODNAME(x) _MODNAME(x)
// module configuration -- TODO: this should be set later from the Makefile... // module configuration -- TODO: this should be set later from the Makefile...
/* commented out by mein@cs.umn.edu default is non static now :)
#if defined(__FreeBSD__) || defined(__linux__) || defined (__sgi) || defined(__sparc) || defined(__sparc__) #if defined(__FreeBSD__) || defined(__linux__) || defined (__sgi) || defined(__sparc) || defined(__sparc__)
#define STATIC_TEXTTOOLS 1 #define STATIC_TEXTTOOLS 1
#endif #endif
*/
#define USE_NMESH 1 // still use NMesh structure for <mesh object>.data #define USE_NMESH 1 // still use NMesh structure for <mesh object>.data

View File

@@ -45,8 +45,8 @@
#include <config.h> #include <config.h>
#endif #endif
int LICENSE_KEY_VALID = FALSE; int LICENSE_KEY_VALID = TRUE;
int I_AM_PUBLISHER = FALSE; int I_AM_PUBLISHER = TRUE;
static UserStruct User; static UserStruct User;
@@ -57,6 +57,8 @@ static UserStruct User;
#include "compile.h" /* to give us PyCodeObject */ #include "compile.h" /* to give us PyCodeObject */
#include "eval.h" /* prototype for PyEval_EvalCode */ #include "eval.h" /* prototype for PyEval_EvalCode */
#include "BPY_extern.h"
#include "IMB_imbuf.h"
Fptr g_functab[PYKEY_TABLEN]; Fptr g_functab[PYKEY_TABLEN];
Fptr g_ptrtab[PYKEY_TABLEN]; Fptr g_ptrtab[PYKEY_TABLEN];
@@ -188,6 +190,7 @@ void create_key_name(char * keyname)
void checkhome() void checkhome()
{ {
initprot(); // initialize module and function tables initprot(); // initialize module and function tables
IMB_fp_png_encode = IMB_png_encode;
} }
void SHOW_LICENSE_KEY(void) void SHOW_LICENSE_KEY(void)

View File

@@ -174,6 +174,7 @@ void winqreadsoundspace(unsigned short event, short val, char ascii)
void sound_initialize_sounds(void) void sound_initialize_sounds(void)
{ {
#if GAMEBLENDER == 1
bSound* sound; bSound* sound;
/* clear the soundscene */ /* clear the soundscene */
@@ -187,6 +188,7 @@ void sound_initialize_sounds(void)
sound_sample_is_null(sound); sound_sample_is_null(sound);
sound = (bSound *) sound->id.next; sound = (bSound *) sound->id.next;
} }
#endif
} }
@@ -194,6 +196,7 @@ void sound_initialize_sounds(void)
bSound* sound_make_copy(bSound* originalsound) bSound* sound_make_copy(bSound* originalsound)
{ {
bSound* sound = NULL; bSound* sound = NULL;
#if GAMEBLENDER == 1
char name[160]; char name[160];
int len; int len;
@@ -236,6 +239,7 @@ bSound* sound_make_copy(bSound* originalsound)
sound->flags &= ~SOUND_FLAGS_3D; sound->flags &= ~SOUND_FLAGS_3D;
} }
#endif
return sound; return sound;
} }
@@ -429,6 +433,7 @@ void sound_read_wav_data(bSound* sound, PackedFile* pf)
int sound_get_filetype_from_header(bSound* sound, PackedFile* pf) int sound_get_filetype_from_header(bSound* sound, PackedFile* pf)
{ {
int i, filetype = SAMPLE_INVALID; int i, filetype = SAMPLE_INVALID;
#if GAMEBLENDER == 1
char buffer[25]; char buffer[25];
short shortbuf; short shortbuf;
@@ -507,6 +512,7 @@ int sound_get_filetype_from_header(bSound* sound, PackedFile* pf)
if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name); if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name);
} }
#endif
return filetype; return filetype;
} }
@@ -571,6 +577,7 @@ int check_filetype(bSound* sound, PackedFile* pf)
int sound_load_sample(bSound* sound) int sound_load_sample(bSound* sound)
{ {
int result = FALSE; int result = FALSE;
#if GAMEBLENDER == 1
PackedFile* pf; PackedFile* pf;
int freePF = FALSE; int freePF = FALSE;
int buffer = -1; int buffer = -1;
@@ -648,6 +655,8 @@ int sound_load_sample(bSound* sound)
result = TRUE; result = TRUE;
} }
#endif
return result; return result;
} }
@@ -656,6 +665,7 @@ int sound_load_sample(bSound* sound)
bSound* sound_new_sound(char* name) bSound* sound_new_sound(char* name)
{ {
bSound *sound = NULL; bSound *sound = NULL;
#if GAMEBLENDER == 1
int len, file; int len, file;
char str[FILE_MAXDIR+FILE_MAXFILE]; char str[FILE_MAXDIR+FILE_MAXFILE];
@@ -700,6 +710,7 @@ bSound* sound_new_sound(char* name)
} }
} }
#endif
return (sound); return (sound);
} }
@@ -708,7 +719,7 @@ bSound* sound_new_sound(char* name)
int sound_set_sample(bSound *sound, bSample *sample) int sound_set_sample(bSound *sound, bSample *sample)
{ {
int result = TRUE; int result = TRUE;
#if GAMEBLENDER == 1
/* decrease the usernumber for this sample */ /* decrease the usernumber for this sample */
if (sound->sample) if (sound->sample)
sound->sample->id.us--; sound->sample->id.us--;
@@ -744,6 +755,9 @@ int sound_set_sample(bSound *sound, bSample *sample)
} }
} }
} }
#endif
return result; return result;
} }
@@ -847,22 +861,27 @@ int sound_sample_is_null(bSound* sound)
void sound_stop_all_sounds(void) void sound_stop_all_sounds(void)
{ {
#if GAMEBLENDER == 1
SND_StopAllSounds(ghSoundScene); SND_StopAllSounds(ghSoundScene);
SND_Proceed(ghAudioDeviceInterface, ghSoundScene); SND_Proceed(ghAudioDeviceInterface, ghSoundScene);
#endif
} }
void sound_end_all_sounds(void) void sound_end_all_sounds(void)
{ {
#if GAMEBLENDER == 1
sound_stop_all_sounds(); sound_stop_all_sounds();
SND_RemoveAllSounds(ghSoundScene); SND_RemoveAllSounds(ghSoundScene);
#endif
} }
void sound_play_sound(bSound* sound) void sound_play_sound(bSound* sound)
{ {
#if GAMEBLENDER == 1
/* first check if we want sound or not */ /* first check if we want sound or not */
SND_IsPlaybackWanted(ghSoundScene); SND_IsPlaybackWanted(ghSoundScene);
@@ -947,6 +966,7 @@ void sound_play_sound(bSound* sound)
} }
} }
} }
#endif
} }
@@ -982,6 +1002,7 @@ static void sound_init_listener(void)
void sound_init_audio(void) void sound_init_audio(void)
{ {
#if GAMEBLENDER == 1
int noaudio; int noaudio;
SYS_SystemHandle hSystem = NULL; SYS_SystemHandle hSystem = NULL;
ghAudioDeviceInterface = NULL; ghAudioDeviceInterface = NULL;
@@ -996,6 +1017,7 @@ void sound_init_audio(void)
ghSoundScene = SND_CreateScene(ghAudioDeviceInterface); ghSoundScene = SND_CreateScene(ghAudioDeviceInterface);
sound_init_listener(); sound_init_listener();
#endif
} }
@@ -1016,7 +1038,9 @@ static void sound_exit_listener(void)
void sound_exit_audio(void) void sound_exit_audio(void)
{ {
#if GAMEBLENDER == 1
SND_DeleteScene(ghSoundScene); SND_DeleteScene(ghSoundScene);
SND_ReleaseDevice(); SND_ReleaseDevice();
sound_exit_listener(); sound_exit_listener();
#endif
} }

View File

@@ -134,7 +134,7 @@
#include "TPT_DependKludge.h" #include "TPT_DependKludge.h"
#ifdef NAN_TPT #ifdef NAN_TPT
#include "BSE_trans_types.h" #include "BSE_trans_types.h"
#include "../img/IMG_Api.h" #include "IMG_Api.h"
#endif /* NAN_TPT */ #endif /* NAN_TPT */
#include "SYS_System.h" /* for the user def menu ... should move elsewhere. */ #include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
@@ -321,6 +321,7 @@ static void restore_all_scene_cfra(LinkNode *storelist) {
void start_game(void) void start_game(void)
{ {
#if GAMEBLENDER == 1
Scene *sc, *startscene = G.scene; Scene *sc, *startscene = G.scene;
LinkNode *scene_cfra_store; LinkNode *scene_cfra_store;
@@ -378,6 +379,7 @@ void start_game(void)
allqueue(REDRAWACTION, 0); allqueue(REDRAWACTION, 0);
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
allqueue(REDRAWIPO, 0); allqueue(REDRAWIPO, 0);
#endif
} }
void changeview3d() void changeview3d()