[Scummvm-cvs-logs] CVS: scummvm/simon simonsys.cpp,1.1,1.2 simon.cpp,1.1,1.2 midi.cpp,1.2,1.3
Ludvig Strigeus
strigeus at users.sourceforge.net
Sat Apr 13 03:42:06 CEST 2002
Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv21737
Modified Files:
simonsys.cpp simon.cpp midi.cpp
Log Message:
possibly fix of compile on unix
Index: simonsys.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simonsys.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** simonsys.cpp 12 Apr 2002 21:26:35 -0000 1.1
--- simonsys.cpp 13 Apr 2002 10:41:26 -0000 1.2
***************
*** 114,125 ****
! /* Dummy midiplayer for unix */
! #ifdef UNIX
! void MidiPlayer::shutdown() {}
! void MidiPlayer::read_all_songs(FILE *in) {}
! void MidiPlayer::initialize() {}
! void MidiPlayer::play() {}
!
!
/* GetAsyncKeyState for unix */
int GetAsyncKeyState(int key) {
--- 114,118 ----
! #ifndef WIN32
/* GetAsyncKeyState for unix */
int GetAsyncKeyState(int key) {
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** simon.cpp 12 Apr 2002 21:26:35 -0000 1.1
--- simon.cpp 13 Apr 2002 10:41:26 -0000 1.2
***************
*** 26,30 ****
#include "simon.h"
!
#include <time.h>
#ifdef WIN32
--- 26,30 ----
#include "simon.h"
! #include <errno.h>
#include <time.h>
#ifdef WIN32
***************
*** 51,55 ****
3624, /* NUM_VOICE_RESOURCES */
1316/4, /* MUSIC_INDEX_BASE */
! -1, /* SOUND_INDEX_BASE */
"simon.gme", /* gme_filename */
"simon.wav", /* wav_filename */
--- 51,55 ----
3624, /* NUM_VOICE_RESOURCES */
1316/4, /* MUSIC_INDEX_BASE */
! 0, /* SOUND_INDEX_BASE */
"simon.gme", /* gme_filename */
"simon.wav", /* wav_filename */
***************
*** 1550,1554 ****
if (_game == GAME_SIMON1WIN) {
uint b = getVarOrByte();
! uint c = getVarOrByte();
uint a = getVarOrByte();
uint d = _array_4[a];
--- 1550,1554 ----
if (_game == GAME_SIMON1WIN) {
uint b = getVarOrByte();
! /*uint c = */getVarOrByte();
uint a = getVarOrByte();
uint d = _array_4[a];
***************
*** 1706,1710 ****
if (_game == GAME_SIMON1WIN) {
uint a = getVarOrByte();
! uint b = getVarOrByte();
uint offs;
Child2 *child = findChildOfType2(getNextItemPtr());
--- 1706,1710 ----
if (_game == GAME_SIMON1WIN) {
uint a = getVarOrByte();
! /*uint b = */getVarOrByte();
uint offs;
Child2 *child = findChildOfType2(getNextItemPtr());
***************
*** 1746,1750 ****
Child2 *child = findChildOfType2(getNextItemPtr());
const char *s;
! ThreeValues *tv;
char buf[256];
--- 1746,1750 ----
Child2 *child = findChildOfType2(getNextItemPtr());
const char *s;
! ThreeValues *tv = NULL;
char buf[256];
***************
*** 3388,3393 ****
uint num_2 = getVarOrByte();
uint string_id = getNextStringID();
! const byte *string_ptr;
! uint speech_id;
ThreeValues *tv;
--- 3388,3393 ----
uint num_2 = getVarOrByte();
uint string_id = getNextStringID();
! const byte *string_ptr = NULL;
! uint speech_id = 0;
ThreeValues *tv;
***************
*** 3397,3402 ****
if (string_id != 0xFFFF)
string_ptr = getStringPtrByID(string_id);
- else
- string_ptr = NULL;
speech_id = (uint16)getNextWord();
--- 3397,3400 ----
***************
*** 3406,3411 ****
if (string_id != 0xFFFF)
string_ptr = getStringPtrByID(string_id);
- else
- string_ptr = NULL;
speech_id = (uint16)getNextWord();
--- 3404,3407 ----
***************
*** 3566,3570 ****
if (_vga_buf_free_start <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
_vga_buf_free_start <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
! vpe->dd = NULL;
vpe->vgaFile1 = NULL;
vpe->vgaFile2 = NULL;
--- 3562,3566 ----
if (_vga_buf_free_start <= vpe->vgaFile1 && end >= vpe->vgaFile1 ||
_vga_buf_free_start <= vpe->vgaFile2 && end >= vpe->vgaFile2) {
! vpe->dd = 0;
vpe->vgaFile1 = NULL;
vpe->vgaFile2 = NULL;
***************
*** 3614,3618 ****
vpe = &_vga_buffer_pointers[a];
! vpe->dd = NULL;
vpe->vgaFile1 = NULL;
vpe->vgaFile2 = NULL;
--- 3610,3614 ----
vpe = &_vga_buffer_pointers[a];
! vpe->dd = 0;
vpe->vgaFile1 = NULL;
vpe->vgaFile2 = NULL;
***************
*** 5735,5739 ****
} else {
uint a = getVarOrWord();
! uint b = getVarOrWord();
if (a!=_last_music_played) {
--- 5731,5735 ----
} else {
uint a = getVarOrWord();
! /*uint b = */getVarOrWord();
if (a!=_last_music_played) {
***************
*** 6160,6164 ****
uint prev_i;
uint x_diff, y_diff;
! uint best_i, best_j, best_dist = 0xFFFFFFFF;
prev_i = 21 - _variableArray[12];
--- 6156,6160 ----
uint prev_i;
uint x_diff, y_diff;
! uint best_i=0, best_j=0, best_dist = 0xFFFFFFFF;
prev_i = 21 - _variableArray[12];
***************
*** 7148,7152 ****
dst_org = dst;
! while (chr=*txt++) {
if (chr == 10) {
dst_org += width * 10;
--- 7144,7148 ----
dst_org = dst;
! while ((chr=*txt++) != 0) {
if (chr == 10) {
dst_org += width * 10;
***************
*** 8698,8701 ****
--- 8694,8699 ----
void SimonState::dump_single_bitmap(int file, int image, byte *offs, int w, int h, byte base) {
+ /* Only supported for win32 atm. mkdir doesn't work otherwise. */
+ #ifdef WIN32
char buf[255], buf2[255];
struct stat statbuf;
***************
*** 8710,8713 ****
--- 8708,8712 ----
dump_bitmap(buf, offs, w, h, 0, _palette, base);
+ #endif
}
***************
*** 8716,8794 ****
}
- #if 0
-
-
- void pal_load(byte *pal, const byte *vga1, int a, int b) {
- uint num = a==0 ? 0x20 : 0x10;
- byte *palptr;
- const byte *src;
-
- palptr = (byte*)&pal[a<<4];
-
- src = vga1 + 6 + b*96;
-
- do {
- palptr[0] = src[0]<<2;
- palptr[1] = src[1]<<2;
- palptr[2] = src[2]<<2;
- palptr[3] = 0;
-
- palptr += 4;
- src += 3;
- } while (--num);
- }
-
- void SimonState::dump_vga_bitmaps(byte *vga, byte *vga1, int res) {
- int i;
- uint32 offs;
- byte *p2;
-
- byte pal[768];
-
- {
- memset(pal, 0, sizeof(pal));
- pal_load(pal, vga1, 2, 0);
- pal_load(pal, vga1, 3, 1);
- pal_load(pal, vga1, 4, 2);
- pal_load(pal, vga1, 5, 3);
- }
-
-
- {
- char buf[255];
- sprintf(buf, "bmp_%d", res);
- mkdir(buf2);
- }
-
-
- int width, height, flags;
-
- // i = 538;
-
- for(i=1; ; i++) {
- p2 = vga + i * 8;
- offs = swap32(*(uint32*)p2);
-
- /* try to detect end of images.
- * assume the end when offset >= 200kb */
- if (offs >= 200*1024)
- return;
-
- width = swap16(*(uint16*)(p2+6));
- height = p2[5];
- flags = p2[4];
-
- fprintf(_dump_file, "Image %d. Width=%d, Height=%d, Flags=0x%X\n", i, width, height, flags);
- fflush(_dump_file);
-
- /* dump bitmap */
- {
- char buf[255];
- sprintf(buf, "bmp_%d\\%d.bmp", res, i);
-
- dump_bitmap(buf, vga + offs, width, height, flags, pal, 0);
- }
- }
- }
- #endif
-
\ No newline at end of file
--- 8715,8716 ----
Index: midi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/midi.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** midi.cpp 13 Apr 2002 04:39:04 -0000 1.2
--- midi.cpp 13 Apr 2002 10:41:27 -0000 1.3
***************
*** 26,29 ****
--- 26,32 ----
#include "simon.h"
+ /* This is win32 only code at the moment */
+ #ifdef WIN32
+
void MidiPlayer::read_from_file(void *dst, uint size) {
if (fread(dst, size, 1, _input) != 1)
***************
*** 704,706 ****
void MidiPlayer::play() {
check_error(midiStreamRestart(_midi_stream_handle));
! }
\ No newline at end of file
--- 707,720 ----
void MidiPlayer::play() {
check_error(midiStreamRestart(_midi_stream_handle));
! }
!
! #else
!
! /* Dummy midiplayer for unix */
! void MidiPlayer::shutdown() {}
! void MidiPlayer::read_all_songs(FILE *in) {}
! void MidiPlayer::read_all_songs_old(FILE *in) {}
! void MidiPlayer::initialize() {}
! void MidiPlayer::play() {}
!
! #endif
\ No newline at end of file
More information about the Scummvm-git-logs
mailing list