[AD] cmake fixes and ogg patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


During the developers meeting, Elias mentioned that my LOGG library
could become an official addon. I went ahead and made a patch against
4.3 that adds it to the build process, in case it is decided that it
should be included. I am attaching the patch, and another one that fixes
various issues with the cmake build process that I found while making
this patch.

I put the LOGG stuff in addons/logg and added some cmake build scripts.
The addon can be built by passing -DWANT_OGG=on to cmake. It does of
course check that the required ogg and vorbis libs are installed first.
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 7866)
+++ CMakeLists.txt	(working copy)
@@ -24,7 +24,7 @@
 project(ALLEGRO C)
 
 # TODO soft-code the version number
-set(ALLEGRO_VERSION 4.3.1)
+set(ALLEGRO_VERSION 4.3.2)
 
 include_directories(
     .
@@ -76,6 +76,8 @@
 option(WANT_OSSMIDI "Enable OSS MIDI driver (Unix)" on)
 option(WANT_SGIAL "Enable SGI AL audio driver (Unix)" on)
 
+option(WANT_OGG "Enable OGG/Vorbis add-on" off)
+
 #
 # For developers.
 #
@@ -643,12 +645,12 @@
         endif(${SOURCE} MATCHES "\\.s$")
     endforeach(SOURCE)
 
-    macro(really_add_allegro_build nm target libtype more_extra_flags)
+    macro(really_add_allegro_build nam target libtype more_extra_flags)
         add_library(${target} ${libtype} ${LIBRARY_SOURCES} ${ASM_OBJS})
         set_target_properties(${target}
             PROPERTIES
             COMPILE_FLAGS "${more_extra_flags} ${LIBRARY_CFLAGS}"
-            OUTPUT_NAME ${nm}
+            OUTPUT_NAME ${nam}
             )
         if(SUPPORT_ASM)
             add_dependencies(${target} asmdef_inc)
@@ -666,7 +668,7 @@
     endmacro(really_add_allegro_build)
 
     if(SHARED)
-        really_add_allegro_build(${nm} ${nm}_shared SHARED "")
+        really_add_allegro_build(${nm}-${ALLEGRO_VERSION} ${nm}_shared SHARED "")
     endif(SHARED)
 
     if(STATIC)
@@ -691,6 +693,27 @@
         "-pg -O2 -funroll-loops -ffast-math")
 endif(GRADE_PROFILE)
 
+if(SHARED)
+    #exec_program(/bin/echo ARGS "************* '${ASM_OBJS}'")
+    add_library(alleg_unsharable STATIC ${ASM_OBJS})
+    set_target_properties(alleg_unsharable
+        PROPERTIES
+        COMPILE_FLAGS "${more_extra_flags} ${LIBRARY_CFLAGS}"
+        OUTPUT_NAME alleg_unsharable
+        LINKER_LANGUAGE C
+        )
+
+    target_link_libraries(alleg_unsharable ${PLATFORM_LIBS})
+
+    install(TARGETS alleg_unsharable
+            DESTINATION lib
+            LIBRARY PERMISSIONS
+                OWNER_READ OWNER_WRITE OWNER_EXECUTE
+                GROUP_READ             GROUP_EXECUTE
+                WORLD_READ             WORLD_EXECUTE
+            )
+endif(SHARED)
+
 #
 # Install header files.
 #
@@ -890,4 +913,11 @@
 make_directory(obj/unix)
 
 #-----------------------------------------------------------------------------#
+#
+#   Add-ons
+#
+#-----------------------------------------------------------------------------#
+
+add_subdirectory(addons)
+
 # vi: set ts=8 sts=4 sw=4 et:
Index: cmake/FileList.cmake
===================================================================
--- cmake/FileList.cmake	(revision 7866)
+++ cmake/FileList.cmake	(working copy)
@@ -486,7 +486,6 @@
 
 set(ALLEGRO_INCLUDE_ALLEGRO_INTERNAL_FILES
     include/allegro/internal/aintern.h
-    include/allegro/internal/aintern2.h
     include/allegro/internal/aintvga.h
     include/allegro/internal/alconfig.h
     )
Index: misc/allegro-config.in
===================================================================
--- misc/allegro-config.in	(revision 7866)
+++ misc/allegro-config.in	(working copy)
@@ -166,7 +166,7 @@
 
 if test "$echo_cflags" = "yes"; then
    if test -n "$include_prefix"; then
-      echo -I${include_path} $allegro_cflags
+      echo -I$include_path $allegro_cflags
    else
       echo $allegro_cflags
    fi
@@ -174,18 +174,18 @@
 
 if test "$echo_cppflags" = "yes"; then
    if test -n "$include_prefix"; then
-      echo -I${include_path} $allegro_cppflags
+      echo -I$include_path $allegro_cppflags
    else
       echo $allegro_cppflags
    fi
 fi
 
 if test "$echo_libs" = "yes"; then
-   libdirs=-L${lib_path}
+   libdirs=-L$lib_path
    if test "$static_libs" = "yes"; then
-      echo $libdirs $allegro_ldflags -l${lib_type} $allegro_libs
+      echo $libdirs $allegro_ldflags -l$lib_type $allegro_libs
    else
-      echo $libdirs $allegro_ldflags -l${lib_type}-${version} -l${lib_type}_unsharable
+      echo $libdirs $allegro_ldflags -l$lib_type-$version -l$lib_type\_unsharable
    fi
 fi
 
Index: addons/logg/LICENSE.TXT
===================================================================
--- addons/logg/LICENSE.TXT	(revision 0)
+++ addons/logg/LICENSE.TXT	(revision 0)
@@ -0,0 +1,22 @@
+Copyright (c) 2007 Trent Gamblin
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Index: addons/logg/play_ogg.c
===================================================================
--- addons/logg/play_ogg.c	(revision 0)
+++ addons/logg/play_ogg.c	(revision 0)
@@ -0,0 +1,13 @@
+#include "logg.h"
+
+int main(int argc, char** argv)
+{
+	allegro_init();
+	install_sound(DIGI_AUTODETECT, MIDI_NONE, 0);
+	install_timer();
+	SAMPLE* s = logg_load(argv[1]);
+	int voice = play_sample(s, 255, 128, 1000, 0);
+	rest(s->len*1000/s->freq);
+	destroy_sample(s);
+	return 0;
+}

Property changes on: addons/logg/play_ogg.c
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/logg/stream_ogg.c
===================================================================
--- addons/logg/stream_ogg.c	(revision 0)
+++ addons/logg/stream_ogg.c	(revision 0)
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+#include "logg.h"
+
+int main(int argc, char** argv)
+{
+	allegro_init();
+	install_sound(DIGI_AUTODETECT, MIDI_NONE, 0);
+	install_timer();
+	LOGG_Stream* s = logg_get_stream(argv[1], 255, 128, 1);
+	if (!s) {
+		printf("Error getting ogg stream.\n");
+		return 1;
+	}
+	while (logg_update_stream(s)) {
+		rest(1);
+	}
+	logg_destroy_stream(s);
+	return 0;
+}

Property changes on: addons/logg/stream_ogg.c
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/logg/logg.c
===================================================================
--- addons/logg/logg.c	(revision 0)
+++ addons/logg/logg.c	(revision 0)
@@ -0,0 +1,253 @@
+#include <string.h>
+
+#include "logg.h"
+
+const int LITTLEENDIAN = 0;
+const int BIGENDIAN = 1;
+
+static int logg_bufsize = 1024*64;
+
+SAMPLE* logg_load(char* filename)
+{
+	OggVorbis_File ovf;
+	FILE* file;
+	vorbis_info* vi;
+	SAMPLE* samp;
+	int numRead;
+	int offset = 0;
+	int bitstream;
+	char buf[logg_bufsize];
+
+	file = fopen(filename, "rb");
+	if (!file) {
+		snprintf(allegro_error, ALLEGRO_ERROR_SIZE, "Unable to open file: %s", filename);
+		return 0;
+	}
+
+	if (ov_open(file, &ovf, 0, 0) != 0) {
+		strncpy(allegro_error, "ov_open failed.", ALLEGRO_ERROR_SIZE);
+		fclose(file);
+		return 0;
+	}
+
+	vi = ov_info(&ovf, -1);
+
+	samp = (SAMPLE*)malloc(sizeof(SAMPLE));
+	if (!samp) {
+		ov_clear(&ovf);
+		return 0;
+	}
+
+	samp->bits = 16;
+	samp->stereo = vi->channels > 1 ? 1 : 0;
+	samp->freq = vi->rate;
+	samp->priority = 128;
+	samp->len = ov_pcm_total(&ovf, -1);
+	samp->loop_start = 0;
+	samp->loop_end = samp->len;
+	samp->data = malloc(sizeof(unsigned short[samp->len*2]));
+
+	while ((numRead = ov_read(&ovf, buf, logg_bufsize,
+				LITTLEENDIAN, 2, 0, &bitstream)) != 0) {
+		memcpy((unsigned char*)samp->data+offset, buf, numRead);
+		offset += numRead;
+	}
+
+	ov_clear(&ovf);
+
+	return samp;
+}
+
+int logg_get_buffer_size()
+{
+	return logg_bufsize;
+}
+
+void logg_set_buffer_size(int size)
+{
+	ASSERT(size > 0);
+	logg_bufsize = size;
+}
+
+static int logg_open_file_for_streaming(LOGG_Stream* s)
+{
+	FILE* file;
+	vorbis_info* vi;
+
+	file = fopen(s->filename, "rb");
+	if (!file) {
+		snprintf(allegro_error, ALLEGRO_ERROR_SIZE, "Unable to open file: %s", s->filename);
+		return 1;
+	}
+
+	if (ov_open(file, &s->ovf, 0, 0) != 0) {
+		strncpy(allegro_error, "ov_open failed.", ALLEGRO_ERROR_SIZE);
+		fclose(file);
+		return 1;
+	}
+
+	vi = ov_info(&s->ovf, -1);
+
+	s->bits = 16;
+	s->stereo = vi->channels > 1 ? 1 : 0;
+	s->freq = vi->rate;
+	s->len = ov_pcm_total(&s->ovf, -1);
+
+	return 0;
+}
+
+static int read_ogg_data(LOGG_Stream* s)
+{
+	int read = 0;
+	int bitstream;
+
+	int page = s->current_page;
+	s->current_page++;
+	s->current_page %= OGG_PAGES_TO_BUFFER;
+
+	memset(s->buf[page], 0, logg_bufsize);
+	
+	while (read < logg_bufsize) {
+		int thisRead = ov_read(&s->ovf, s->buf[page]+read,
+				logg_bufsize-read,
+				LITTLEENDIAN, 2, 0, &bitstream);
+		if (thisRead == 0) {
+			if (s->loop) {
+				ov_clear(&s->ovf);
+				if (logg_open_file_for_streaming(s)) {
+					return -1;
+				}
+			}
+			else {
+				return read;
+			}
+		}
+		read += thisRead;
+	}
+
+	return read;
+}
+
+static int logg_play_stream(LOGG_Stream* s)
+{
+	s->current_page = 0;
+	s->playing_page = -1;
+
+	int len = logg_bufsize / (s->stereo ? 2 : 1)
+		/ (s->bits / (sizeof(char)*8));
+
+	s->audio_stream = play_audio_stream(len,
+		       	s->bits, s->stereo,
+			s->freq, s->volume, s->pan);
+
+	if (!s->audio_stream) {
+		return 1;
+	}
+
+	int i;
+	int j;
+
+	for (i = 0; i < OGG_PAGES_TO_BUFFER; i++) {
+		s->buf[i] = malloc(logg_bufsize);
+		if (!s->buf[i]) {
+			logg_destroy_stream(s);
+			return 1;
+		}
+		if (read_ogg_data(s) < 0) {
+			return 1;
+		}
+	}
+
+	return 0;
+}
+
+LOGG_Stream* logg_get_stream(char* filename, int volume, int pan, int loop)
+{
+	LOGG_Stream* s = calloc(1, sizeof(LOGG_Stream));
+	if (!s) {
+		return 0;
+	}
+
+	s->filename = strdup(filename);
+
+	if (!s->filename) {
+		free(s);
+		return 0;
+	}
+
+	if (logg_open_file_for_streaming(s)) {
+		logg_destroy_stream(s);
+		return 0;
+	}
+
+	s->volume = volume;
+	s->pan = pan;
+	s->loop = loop;
+
+	if (logg_play_stream(s)) {
+		logg_destroy_stream(s);
+		return 0;
+	}
+
+	return s;
+}
+
+int logg_update_stream(LOGG_Stream* s)
+{
+	unsigned char* data = get_audio_stream_buffer(s->audio_stream);
+
+	if (!data) {
+		if (s->current_page != s->playing_page) {
+			int read = read_ogg_data(s);
+			if (read < logg_bufsize) {
+				return 0;
+			}
+			else {
+				return 1;
+			}
+		}
+		else {
+			return 1;
+		}
+	}
+
+	s->playing_page++;
+	s->playing_page %= OGG_PAGES_TO_BUFFER;
+	memcpy(data, s->buf[s->playing_page], logg_bufsize);
+
+	free_audio_stream_buffer(s->audio_stream);
+
+	return 1;
+}
+
+void logg_stop_stream(LOGG_Stream* s)
+{
+	stop_audio_stream(s->audio_stream);
+	int i;
+	for (i = 0; i < OGG_PAGES_TO_BUFFER; i++) {
+		free(s->buf[i]);
+		s->buf[i] = 0;
+	}
+}
+
+int logg_restart_stream(LOGG_Stream* s)
+{
+	return logg_play_stream(s);
+}
+
+void logg_destroy_stream(LOGG_Stream* s)
+{
+	if (s->audio_stream) {
+		stop_audio_stream(s->audio_stream);
+	}
+	ov_clear(&s->ovf);
+	int i;
+	for (i = 0; i < OGG_PAGES_TO_BUFFER; i++) {
+		if (s->buf[i]) {
+			free(s->buf[i]);
+		}
+	}
+	free(s->filename);
+	free(s);
+}
+

Property changes on: addons/logg/logg.c
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/logg/CMakeLists.txt
===================================================================
--- addons/logg/CMakeLists.txt	(revision 0)
+++ addons/logg/CMakeLists.txt	(revision 0)
@@ -0,0 +1,63 @@
+set(OGG_VORBIS_LIBS vorbisfile vorbis ogg)
+set(LOGG_SOURCES logg.c)
+set(LOGG_INCLUDE_FILES logg.h)
+
+#-----------------------------------------------------------------------------#
+
+macro(add_logg_build nm extra_flags)
+    macro(really_add_logg_build nm target libtype more_extra_flags)
+        add_library(${target} ${libtype} ${LOGG_SOURCES})
+        set_target_properties(${target}
+            PROPERTIES
+            COMPILE_FLAGS "${more_extra_flags} ${LIBRARY_CFLAGS}"
+            OUTPUT_NAME ${nm}
+            )
+
+        target_link_libraries(${target} ${OGG_VORBIS_LIBS})
+
+        install(TARGETS ${target}
+                DESTINATION lib
+                LIBRARY PERMISSIONS
+                    OWNER_READ OWNER_WRITE OWNER_EXECUTE
+                    GROUP_READ             GROUP_EXECUTE
+                    WORLD_READ             WORLD_EXECUTE
+                )
+    endmacro(really_add_logg_build)
+
+    if(SHARED)
+        really_add_logg_build(${nm} ${nm}_shared SHARED "")
+    endif(SHARED)
+
+    if(STATIC)
+        really_add_logg_build(${nm} ${nm}_static STATIC "")
+    endif(STATIC)
+
+endmacro(add_logg_build)
+
+if(GRADE_STANDARD)
+    add_logg_build(logg
+        "-O2 -funroll-loops -ffast-math -fomit-frame-pointer")
+endif(GRADE_STANDARD)
+
+if(GRADE_DEBUG)
+    add_logg_build(loggd
+        "-DDEBUGMODE -g")
+endif(GRADE_DEBUG)
+
+if(GRADE_PROFILE)
+    add_logg_build(loggp
+        "-pg -O2 -funroll-loops -ffast-math")
+endif(GRADE_PROFILE)
+
+#-----------------------------------------------------------------------------#
+
+#
+# Install header files.
+#
+
+install(FILES ${LOGG_INCLUDE_FILES}
+        DESTINATION include
+        )
+
+#-----------------------------------------------------------------------------#
+# vi: set ts=8 sts=4 sw=4 et:

Property changes on: addons/logg/CMakeLists.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/logg/Makefile
===================================================================
--- addons/logg/Makefile	(revision 0)
+++ addons/logg/Makefile	(revision 0)
@@ -0,0 +1,178 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.4
+
+# Default target executed when no arguments are given to make.
+default_target: all
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The program to use to edit the cache.
+CMAKE_EDIT_COMMAND = /usr/bin/ccmake
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/trent/4.3
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/trent/4.3
+
+# Include the progress variables for this target.
+include CMakeFiles/progress.make
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
+	cd /home/trent/4.3/addons/logg && /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+
+# Special rule for the target install
+install: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	cd /home/trent/4.3/addons/logg && /usr/bin/cmake -P cmake_install.cmake
+
+# Special rule for the target install
+install/fast: preinstall/fast
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	cd /home/trent/4.3/addons/logg && /usr/bin/cmake -P cmake_install.cmake
+
+# Special rule for the target install/local
+install/local: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
+	cd /home/trent/4.3/addons/logg && /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
+
+# Special rule for the target install/local
+install/local/fast: install/local
+
+# Special rule for the target list_install_components
+list_install_components:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Only default component available"
+
+# Special rule for the target list_install_components
+list_install_components/fast: list_install_components
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+	cd /home/trent/4.3/addons/logg && /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+
+# The main all target
+all: cmake_check_build_system
+	cd /home/trent/4.3 && $(CMAKE_COMMAND) -E cmake_progress_start /home/trent/4.3/CMakeFiles $(CMAKE_ALL_PROGRESS)
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/trent/4.3/CMakeFiles 0
+
+# The main clean target
+clean:
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/clean
+
+# The main clean target
+clean/fast: clean
+
+# Prepare targets for installation.
+preinstall: all
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/preinstall
+
+# clear depends
+depend:
+	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+
+# Convenience name for target.
+addons/logg/CMakeFiles/logg_shared.dir/rule:
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/CMakeFiles/logg_shared.dir/rule
+
+# Convenience name for target.
+logg_shared: addons/logg/CMakeFiles/logg_shared.dir/rule
+
+# fast build rule for target.
+logg_shared/fast:
+	cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_shared.dir/build.make addons/logg/CMakeFiles/logg_shared.dir/build
+
+# Convenience name for target.
+addons/logg/CMakeFiles/logg_static.dir/rule:
+	cd /home/trent/4.3 && $(MAKE) -f CMakeFiles/Makefile2 addons/logg/CMakeFiles/logg_static.dir/rule
+
+# Convenience name for target.
+logg_static: addons/logg/CMakeFiles/logg_static.dir/rule
+
+# fast build rule for target.
+logg_static/fast:
+	cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_static.dir/build.make addons/logg/CMakeFiles/logg_static.dir/build
+
+# target to build an object file
+logg.o:
+	cd /home/trent/4.3 && cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_shared.dir/build.make addons/logg/CMakeFiles/logg_shared.dir/logg.o
+	cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_static.dir/build.make addons/logg/CMakeFiles/logg_static.dir/logg.o
+
+# target to preprocess a source file
+logg.i:
+	cd /home/trent/4.3 && cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_shared.dir/build.make addons/logg/CMakeFiles/logg_shared.dir/logg.i
+	cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_static.dir/build.make addons/logg/CMakeFiles/logg_static.dir/logg.i
+
+# target to generate assembly for a file
+logg.s:
+	cd /home/trent/4.3 && cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_shared.dir/build.make addons/logg/CMakeFiles/logg_shared.dir/logg.s
+	cd /home/trent/4.3 && $(MAKE) -f addons/logg/CMakeFiles/logg_static.dir/build.make addons/logg/CMakeFiles/logg_static.dir/logg.s
+
+# Help Target
+help::
+	@echo "The following are some of the valid targets for this Makefile:"
+	@echo "... all (the default if no target is provided)"
+	@echo "... clean"
+	@echo "... depend"
+	@echo "... edit_cache"
+	@echo "... install"
+	@echo "... install/local"
+	@echo "... list_install_components"
+	@echo "... logg_shared"
+	@echo "... logg_static"
+	@echo "... rebuild_cache"
+	@echo "... logg.o"
+	@echo "... logg.i"
+	@echo "... logg.s"
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+	cd /home/trent/4.3 && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+

Property changes on: addons/logg/Makefile
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/logg/logg.h
===================================================================
--- addons/logg/logg.h	(revision 0)
+++ addons/logg/logg.h	(revision 0)
@@ -0,0 +1,36 @@
+#ifndef LOGG_H
+#define LOGG_H
+
+#include <allegro.h>
+#include <vorbis/vorbisfile.h>
+
+#define OGG_PAGES_TO_BUFFER 2
+
+typedef struct {
+	char *buf[OGG_PAGES_TO_BUFFER];
+	int current_page;
+	int playing_page;
+	AUDIOSTREAM* audio_stream;
+	OggVorbis_File ovf;
+	int bits;
+	int stereo;
+	int freq;
+	int len;
+	char* filename;
+	int loop;
+	int volume;
+	int pan;
+} LOGG_Stream;
+
+extern SAMPLE* logg_load(char* filename);
+extern int logg_get_buffer_size();
+extern void logg_set_buffer_size(int size);
+extern LOGG_Stream* logg_get_stream(char* filename,
+		int volume, int pan, int loop);
+extern int logg_update_stream(LOGG_Stream* s);
+extern void logg_destroy_stream(LOGG_Stream* s);
+extern void logg_stop_stream(LOGG_Stream* s);
+extern int logg_restart_stream(LOGG_Stream* s);
+
+#endif
+

Property changes on: addons/logg/logg.h
___________________________________________________________________
Name: svn:eol-style
   + native

Index: addons/CMakeLists.txt
===================================================================
--- addons/CMakeLists.txt	(revision 0)
+++ addons/CMakeLists.txt	(revision 0)
@@ -0,0 +1,15 @@
+#-----------------------------------------------------------------------------#
+#
+#   Platform configuration
+#
+#-----------------------------------------------------------------------------#
+
+if(WANT_OGG)
+    check_library_exists(vorbisfile ov_open "" CAN_OGG)
+    if (CAN_OGG)
+        add_subdirectory(logg)
+    endif (CAN_OGG)
+endif(WANT_OGG)
+
+#-----------------------------------------------------------------------------#
+# vi: set ts=8 sts=4 sw=4 et:

Property changes on: addons/CMakeLists.txt
___________________________________________________________________
Name: svn:eol-style
   + native



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/