[Scummvm-cvs-logs] CVS: tools extract.h,NONE,1.1 util.h,NONE,1.1 descumm.h,1.7,1.8 simon2mp3.c,1.14,1.15 mm_nes_extract.c,1.6,1.7 extract.c,1.26,1.27

Max Horn fingolfin at users.sourceforge.net
Sun Nov 9 04:57:18 CET 2003


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv5525

Modified Files:
	descumm.h simon2mp3.c mm_nes_extract.c extract.c 
Added Files:
	extract.h util.h 
Log Message:
update legal headers; moved common code to util.h; begun work on refactoring extract/simon2mp3 to properly shared code

--- NEW FILE: extract.h ---
/* Scumm Tools
 * Copyright (C) 2002, 2003  The ScummVM Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/tools/extract.h,v 1.1 2003/11/09 12:55:38 fingolfin Exp $
 *
 */

#ifndef EXTRACT_H
#define EXTRACT_H

/* These are the defaults parameters for the Lame invocation */
#define minBitrDef 24
#define maxBitrDef 64
#define abrDef 0
#define vbrDef 1
#define algqualDef 2
#define vbrqualDef 4

/* The default for oggenc invocation is to use the --quality option only */
#define oggqualDef 3




#endif

--- NEW FILE: util.h ---
/* Scumm Tools
 * Copyright (C) 2002, 2003  The ScummVM Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/tools/util.h,v 1.1 2003/11/09 12:55:38 fingolfin Exp $
 *
 */

#ifndef UTIL_H
#define UTIL_H

#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

#if !defined(_MSC_VER)
#include <unistd.h>
#endif

#ifdef WIN32
#include <io.h>
#include <process.h>
#endif


/*
 * Various utility macros
 */

#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))

typedef unsigned char byte;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned int uint;
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;

uint32 inline SWAP_32(uint32 a)
{
	return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + ((a << 8) & 0xFF0000) +
		((a << 24) & 0xFF000000);
}

uint16 inline SWAP_16(uint16 a)
{
	return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00);
}

#if defined(SCUMM_BIG_ENDIAN)
#define TO_BE_32(a) (a)
#define TO_BE_16(a) (a)
#define TO_LE_32(a) SWAP_32(a)
#define TO_LE_16(a) SWAP_16(a)
#else
#define TO_BE_32(a) SWAP_32(a)
#define TO_BE_16(a) SWAP_16(a)
#define TO_LE_32(a) (a)
#define TO_LE_16(a) (a)
#endif

#define MKID(a) (((a&0xff) << 8) | ((a >> 8)&0xff))


#endif

Index: descumm.h
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- descumm.h	11 Oct 2003 18:23:38 -0000	1.7
+++ descumm.h	9 Nov 2003 12:55:38 -0000	1.8
@@ -23,56 +23,7 @@
 #ifndef DESCUMM_H
 #define DESCUMM_H
 
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef WIN32
-#include <io.h>
-#include <process.h>
-#endif
-
-//
-// Various utility macros
-//
-
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-
-typedef unsigned char byte;
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
-typedef unsigned int uint;
-typedef signed char int8;
-typedef signed short int16;
-typedef signed int int32;
-
-uint32 inline SWAP_32(uint32 a)
-{
-	return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + ((a << 8) & 0xFF0000) +
-		((a << 24) & 0xFF000000);
-}
-
-uint16 inline SWAP_16(uint16 a)
-{
-	return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00);
-}
-
-#if defined(SCUMM_BIG_ENDIAN)
-#define TO_BE_32(a) (a)
-#define TO_BE_16(a) (a)
-#define TO_LE_32(a) SWAP_32(a)
-#define TO_LE_16(a) SWAP_16(a)
-#else
-#define TO_BE_32(a) SWAP_32(a)
-#define TO_BE_16(a) SWAP_16(a)
-#define TO_LE_32(a) (a)
-#define TO_LE_16(a) (a)
-#endif
-
-#define MKID(a) (((a&0xff) << 8) | ((a >> 8)&0xff))
+#include "util.h"
 
 
 //

Index: simon2mp3.c
===================================================================
RCS file: /cvsroot/scummvm/tools/simon2mp3.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- simon2mp3.c	20 Oct 2003 23:37:16 -0000	1.14
+++ simon2mp3.c	9 Nov 2003 12:55:38 -0000	1.15
@@ -1,5 +1,5 @@
 /* Simon2mp3 - Compress Simon the Sorcerer 1/2 digital sound files into MP3-format
- * Copyright (C) 2002  The ScummVM Team
+ * Copyright (C) 2002, 2003  The ScummVM Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -19,25 +19,8 @@
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#if !defined(_MSC_VER)
-#include <unistd.h>
-#endif
-
-/* These are the defaults parameters for the Lame invocation */
-#define minBitrDef 24
-#define maxBitrDef 64
-#define abrDef 0
-#define vbrDef 1
-#define algqualDef 2
-#define vbrqualDef 4
-
-/* The default for oggenc invocation is to use the --quality option only */
-#define oggqualDef 3
+#include "util.h"
+#include "extract.h"
 
 FILE *input, *output_idx, *output_snd;
 
@@ -167,7 +150,7 @@
 
 	for (i = 0;; i++) {
 		get_string(8);
-		if (!strncmp(buf, "Creative", 8) || !strncmp(buf, "RIFF", 4)) {
+		if (!memcmp(buf, "Creative", 8) || !memcmp(buf, "RIFF", 4)) {
 			return(i);
 		}
 		fseek(input, -8, SEEK_CUR);
@@ -204,10 +187,10 @@
 	fseek(input, offsets[sound], SEEK_SET);
 
 	get_string(8);
-	if (!strncmp(buf, "Creative", 8)) {
+	if (!memcmp(buf, "Creative", 8)) {
 		printf("VOC found (pos = %d) :\n", offsets[sound]);
 		get_voc();
-	} else if (!strncmp(buf, "RIFF", 4)) {
+	} else if (!memcmp(buf, "RIFF", 4)) {
 		printf("WAV found (pos = %d) :\n", offsets[sound]);
 		get_wav();
 	} else {

Index: mm_nes_extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/mm_nes_extract.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mm_nes_extract.c	20 Oct 2003 23:37:16 -0000	1.6
+++ mm_nes_extract.c	9 Nov 2003 12:55:39 -0000	1.7
@@ -1,5 +1,5 @@
 /* MM_NES_Extract - Extract data files from NES version of Maniac Mansion
- * Copyright (C) 2002  The ScummVM Team
+ * Copyright (C) 2003  The ScummVM Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License

Index: extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- extract.c	15 Sep 2003 18:24:18 -0000	1.26
+++ extract.c	9 Nov 2003 12:55:39 -0000	1.27
@@ -1,5 +1,5 @@
 /* Extract - monster.sou to MP3-compressed monster.so3 converter
- * Copyright (C) 2002  The ScummVM Team
+ * Copyright (C) 2002, 2003  The ScummVM Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -19,28 +19,8 @@
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#if !defined(_MSC_VER)
-#include <unistd.h>
-#endif
-
-typedef unsigned int uint32;
-typedef unsigned char byte;
-
-/* These are the defaults parameters for the Lame invocation */
-#define minBitrDef 24
-#define maxBitrDef 64
-#define abrDef 0
-#define vbrDef 1
-#define algqualDef 2
-#define vbrqualDef 4
-
-/* The default for oggenc invocation is to use the --quality option only */
-#define oggqualDef 3
+#include "util.h"
+#include "extract.h"
 
 FILE *input, *output_idx, *output_snd;
 





More information about the Scummvm-git-logs mailing list