205
212
if ( readInt() == 1 ) wave_play_loop_flag = true;
206
213
else wave_play_loop_flag = false;
207
214
if ( wave_file_name && wave_play_loop_flag )
208
playWave( wave_file_name, wave_play_loop_flag, MIX_WAVE_CHANNEL );
215
playSound(wave_file_name, SOUND_WAVE|SOUND_OGG, wave_play_loop_flag, MIX_WAVE_CHANNEL);
210
217
// play, playonce
211
218
if ( readInt() == 1 ) cd_play_loop_flag = true;
212
219
else cd_play_loop_flag = false;
213
if ( current_cd_track >= 0 ){
215
if ( cdrom_info ) playCDAudio( current_cd_track );
218
playMP3( current_cd_track );
220
if ( current_cd_track >= 0 ) playCDAudio();
222
222
// bgm, mp3, mp3loop
223
223
if ( readInt() == 1 ) music_play_loop_flag = true;
226
226
else mp3save_flag = false;
227
227
readStr( &music_file_name );
228
228
if ( music_file_name ){
229
if ( playWave( music_file_name, music_play_loop_flag, MIX_BGM_CHANNEL ) )
230
#if defined(EXTERNAL_MUSIC_PLAYER)
231
if (playMusicFile()){
235
internal_midi_play_loop_flag = music_play_loop_flag;
236
playMIDIFile(music_file_name);
229
playSound(music_file_name,
230
SOUND_WAVE | SOUND_OGG_STREAMING | SOUND_MP3 | SOUND_MIDI,
231
music_play_loop_flag, MIX_BGM_CHANNEL);
240
234
erase_text_window_mode = readInt();
330
324
readStr( &loop_bgm_name[0] );
331
325
readStr( &loop_bgm_name[1] );
332
326
if ( loop_bgm_name[0] ) {
333
if ( loop_bgm_name[1] ) playWave( loop_bgm_name[1], false, MIX_LOOPBGM_CHANNEL1, WAVE_PRELOAD );
334
playWave( loop_bgm_name[0], false, MIX_LOOPBGM_CHANNEL0 );
327
if ( loop_bgm_name[1] )
328
playSound(loop_bgm_name[1],
329
SOUND_PRELOAD|SOUND_WAVE|SOUND_OGG, false, MIX_LOOPBGM_CHANNEL1);
330
playSound(loop_bgm_name[0],
331
SOUND_WAVE|SOUND_OGG, false, MIX_LOOPBGM_CHANNEL0);
337
334
if ( file_version >= 201 ){
340
337
ruby_struct.font_size_xy[0] = readInt();
341
338
ruby_struct.font_size_xy[1] = readInt();
342
339
readStr( &ruby_struct.font_name );
340
sentence_font.setRubyOnFlag(rubyon_flag);
343
if (file_version >= 204){
346
for ( i=0 ; i<MAX_SPRITE2_NUM ; i++ ){
347
sprite2_info[i].remove();
348
readStr( &sprite2_info[i].image_name );
349
if ( sprite2_info[i].image_name ){
350
parseTaggedString( &sprite2_info[i] );
351
setupAnimationInfo( &sprite2_info[i] );
353
sprite2_info[i].pos.x = readInt() * screen_ratio1 / screen_ratio2;
354
sprite2_info[i].pos.y = readInt() * screen_ratio1 / screen_ratio2;
355
sprite2_info[i].scale_x = readInt();
356
sprite2_info[i].scale_y = readInt();
357
sprite2_info[i].rot = readInt();
358
if ( readInt() == 1 ) sprite2_info[i].visible = true;
359
else sprite2_info[i].visible = false;
362
sprite2_info[i].trans = 256;
364
sprite2_info[i].trans = j;
365
sprite2_info[i].blending_mode = readInt();
370
if (file_version >= 205) readInt(); // 1
375
if (file_version >= 205) readChar(); // 0
345
378
int text_num = readInt();
346
start_text_buffer = current_text_buffer;
379
start_page = current_page;
347
380
for ( i=0 ; i<text_num ; i++ ){
348
clearCurrentTextBuffer();
350
current_text_buffer->buffer2[current_text_buffer->buffer2_count] = readChar();
383
current_page->text[current_page->text_count] = readChar();
352
while( current_text_buffer->buffer2[current_text_buffer->buffer2_count++] );
353
current_text_buffer->buffer2_count--;
354
current_text_buffer = current_text_buffer->next;
385
while( current_page->text[current_page->text_count++] );
386
if (file_version == 203) readChar(); // 0
387
current_page->text_count--;
388
current_page = current_page->next;
356
clearCurrentTextBuffer();
392
if (file_version >= 205){
393
Page *page = start_page;
395
for (i=0 ; i<j ; i++){
400
else if (file_version >= 204){
359
406
current_label_info = script_h.getLabelByLine( i );
360
407
current_line = i - current_label_info.start_line;
436
481
writeInt( 0, output_flag );
437
482
writeInt( 0, output_flag );
438
483
writeInt( 0, output_flag );
485
writeInt( -1, output_flag );
486
writeInt( -1, output_flag );
487
writeInt( -1, output_flag );
440
489
for ( i=0 ; i<MAX_SPRITE_NUM ; i++ ){
441
490
writeStr( sprite_info[i].image_name, output_flag );
562
612
writeInt( ruby_struct.font_size_xy[1], output_flag );
563
613
writeStr( ruby_struct.font_name, output_flag );
565
TextBuffer *tb = current_text_buffer;
567
while( tb != start_text_buffer ){
571
writeInt( text_num, output_flag );
573
for ( i=0 ; i<text_num ; i++ ){
574
for ( j=0 ; j<tb->buffer2_count ; j++ )
575
writeChar( tb->buffer2[j], output_flag );
576
writeChar( 0, output_flag );
615
writeInt( 0, output_flag );
617
for ( i=0 ; i<MAX_SPRITE2_NUM ; i++ ){
618
writeStr( sprite2_info[i].image_name, output_flag );
619
writeInt( sprite2_info[i].pos.x * screen_ratio2 / screen_ratio1, output_flag );
620
writeInt( sprite2_info[i].pos.y * screen_ratio2 / screen_ratio1, output_flag );
621
writeInt( sprite2_info[i].scale_x, output_flag );
622
writeInt( sprite2_info[i].scale_y, output_flag );
623
writeInt( sprite2_info[i].rot, output_flag );
624
writeInt( sprite2_info[i].visible?1:0, output_flag );
625
if (sprite2_info[i].trans == 256)
626
writeInt( -1, output_flag );
628
writeInt( sprite2_info[i].trans, output_flag );
629
writeInt( sprite2_info[i].blending_mode, output_flag );
632
writeInt( 0, output_flag );
633
writeInt( 0, output_flag );
634
writeInt( 1, output_flag ); // added in version 205
635
writeInt( 0, output_flag );
636
writeInt( 0, output_flag );
637
writeInt( 0, output_flag );
638
writeInt( 0, output_flag );
639
writeChar( 0, output_flag ); // added in version 205
641
Page *page = current_page;
643
while( page != start_page ){
644
page = page->previous;
648
writeInt( num_page, output_flag );
649
for ( i=0 ; i<num_page ; i++ ){
650
for ( j=0 ; j<page->text_count ; j++ )
651
writeChar( page->text[j], output_flag );
652
writeChar( 0, output_flag );
657
writeInt(num_page, output_flag);
658
for (i=0 ; i<num_page ; i++){
660
for ( j=0 ; j<(int)strlen(page->tag) ; j++ )
661
writeChar( page->tag[j], output_flag );
662
writeChar( 0, output_flag );
580
666
writeInt( current_label_info.start_line + current_line, output_flag );
581
667
char *buf = script_h.getAddressByLine( current_label_info.start_line + current_line );
582
668
//printf("save %d:%d\n", current_label_info.start_line, current_line);