switch to ov_fopen for simplicity
authorkoda
Sun, 19 Jul 2009 00:57:49 +0000
changeset 2266 289dc8e51210
parent 2265 eae64600fb69
child 2267 ad372e549cc5
switch to ov_fopen for simplicity adds a couple of files i forgot to commit
QTfrontend/AutoUpdater.cpp
QTfrontend/AutoUpdater.h
openalbridge/loaders.c
openalbridge/oggvorbis.h
share/hedgewars/Data/Themes/CrazyMission/Sky-lowres.png
share/hedgewars/Data/Themes/CrazyMission/horizont-lowres.png
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/AutoUpdater.cpp	Sun Jul 19 00:57:49 2009 +0000
@@ -0,0 +1,9 @@
+/*
+ * Copyright (C) 2008 Remko Troncon
+ */
+
+#include "AutoUpdater.h"
+
+AutoUpdater::~AutoUpdater()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/AutoUpdater.h	Sun Jul 19 00:57:49 2009 +0000
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2008 Remko Troncon
+ */
+
+#ifndef AUTOUPDATER_H
+#define AUTOUPDATER_H
+
+class AutoUpdater
+{
+	public:
+		virtual ~AutoUpdater();
+
+		virtual void checkForUpdates() = 0;
+};
+
+#endif
--- a/openalbridge/loaders.c	Sun Jul 19 00:52:09 2009 +0000
+++ b/openalbridge/loaders.c	Sun Jul 19 00:57:49 2009 +0000
@@ -128,21 +128,19 @@
 
     int load_oggvorbis (const char *filename, ALenum *format, char **data, ALsizei *bitsize, ALsizei *freq) {
         /*implementation inspired from http://www.devmaster.net/forums/showthread.php?t=1153 */
-        FILE		*oggFile;		/*ogg handle*/
-        OggVorbis_File  oggStream;		/*stream handle*/
+        OggVorbis_File  oggStream;	/*stream handle*/
         vorbis_info	*vorbisInfo;	/*some formatting data*/
-        int64_t		pcm_length;		/*length of the decoded data*/
+        int64_t		pcm_length;	/*length of the decoded data*/
         int             section, result, size = 0;
 #ifdef DEBUG
         int i;
         vorbis_comment	*vorbisComment;	/*other less useful data*/
 #endif
 
-        oggFile = Fopen(filename, "rb");
-	result = ov_open_callbacks(oggFile, &oggStream, NULL, 0, NULL);
+	result = ov_fopen((char*) filename, &oggStream);
 	if (result < 0) {
-		fprintf (stderr, "ERROR: ov_open_callbacks failed with %X", result) 
-		fclose(oggFile);
+		fprintf (stderr, "ERROR: ov_open_callbacks failed with %X", result);
+                ov_clear(&oggStream);
 		return -1;
 	}
 
@@ -177,7 +175,6 @@
             else {
                 fprintf(stderr, "ERROR: wrong OGG header - channel value (%d)\n", vorbisInfo->channels);
                 ov_clear(&oggStream);
-                fclose(oggFile);
                 return AL_FALSE;
             }
         }
@@ -193,7 +190,6 @@
                 else { 
                     fprintf(stderr, "ERROR: end of file from OGG stream\n");
                     ov_clear(&oggStream);
-                    fclose(oggFile);
                     return AL_FALSE;
                 }
             }
@@ -205,7 +201,6 @@
         
 	/*cleaning time*/
         ov_clear(&oggStream);
-	fclose(oggFile);
 
         return AL_TRUE;
     }
--- a/openalbridge/oggvorbis.h	Sun Jul 19 00:52:09 2009 +0000
+++ b/openalbridge/oggvorbis.h	Sun Jul 19 00:57:49 2009 +0000
@@ -164,12 +164,11 @@
 
 
 extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
+extern int ov_fopen(char *path,OggVorbis_File *vf);
 extern long ov_read(OggVorbis_File *vf,char *buffer,int length,int bigendianp,int word,int sgned,int *bitstream);
 extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
-extern long ov_read(OggVorbis_File *vf,char *buffer,int length,int bigendianp,int word,int sgned,int *bitstream);
 extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
 extern vorbis_comment *ov_comment(OggVorbis_File *f, int num);
 extern int ov_clear(OggVorbis_File *vf);
-extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
 
 #endif /*_OGGVORBIS_H*/
Binary file share/hedgewars/Data/Themes/CrazyMission/Sky-lowres.png has changed
Binary file share/hedgewars/Data/Themes/CrazyMission/horizont-lowres.png has changed