diff --git a/sfxr/ChangeLog b/sfxr/CHANGES.txt similarity index 89% rename from sfxr/ChangeLog rename to sfxr/CHANGES.txt index 843688f..d224c26 100644 --- a/sfxr/ChangeLog +++ b/sfxr/CHANGES.txt @@ -19,4 +19,6 @@ sfxr-sdl-1.2.0 * Clicking sets the value of a slider * Sound now plays when an attribute is clicked (a more involved change, like looping, would be needed for dragging) * Sound now plays on waveform change -* Very simple undo (one slider change) with Z \ No newline at end of file +* Very simple undo (one slider change) with Z +* Removed GTK save/load dialog +* Added CMake build \ No newline at end of file diff --git a/sfxr/CMakeLists.txt b/sfxr/CMakeLists.txt index e71c1a8..ac88e4e 100644 --- a/sfxr/CMakeLists.txt +++ b/sfxr/CMakeLists.txt @@ -25,24 +25,24 @@ find_package(SDL REQUIRED) include_directories(include ${SDL_INCLUDE_DIR}) link_libraries(${SDL_LIBRARY}) -add_definitions("-Wall -pedantic") +add_definitions("-Wall --pedantic -O2") set(SRC_FILES - main.cpp - sdlkit.cpp - tools.cpp + source/main.cpp + source/sdlkit.cpp + source/tools.cpp ) add_executable(sfxr ${SRC_FILES}) install(TARGETS sfxr - RUNTIME DESTINATION .) -install(FILES font.tga ld48.tga sfxr.bmp readme.txt - DESTINATION share/sfxr) -install(FILES sfxr.png + RUNTIME DESTINATION bin) +install(FILES images/font.tga images/ld48.tga images/sfxr.bmp + DESTINATION share/sfxr/images) +install(FILES images/sfxr.png DESTINATION share/icons/hicolor/48x48/apps) -install(FILES sfxr.1 +install(FILES data/sfxr.1 DESTINATION share/man/man1) -install(FILES sfxr.desktop +install(FILES data/sfxr.desktop DESTINATION share/applications) diff --git a/sfxr/INSTALL.txt b/sfxr/INSTALL.txt new file mode 100644 index 0000000..98897b8 --- /dev/null +++ b/sfxr/INSTALL.txt @@ -0,0 +1,16 @@ +You can build and install with either Automake or CMake. Use CMake if you are not using Linux/Unix. + +Automake: +./autogen.sh +./configure +make +sudo make install + +CMake (not GUI): +cmake -G Unix\ Makefiles +make +sudo make install + +Note the install is hardcoded to /usr, you can also run sfxr from the build +dir after make (./sfxr) without installing. + diff --git a/sfxr/LICENSE.txt b/sfxr/LICENSE.txt new file mode 100644 index 0000000..fb6334e --- /dev/null +++ b/sfxr/LICENSE.txt @@ -0,0 +1,40 @@ +----------------------------- +sfxr - sound effect generator +----------------------------- + by DrPetter, 2007-12-14 + developed for LD48#10 +----------------------------- + + +License +------- + +Basically, I don't care what you do with it, anything goes. + +To please all the troublesome folks who request a formal license, +I attach the "MIT license" as follows: + +-- + +Copyright (c) 2007 Tomas Pettersson + +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. diff --git a/sfxr/Makefile.am b/sfxr/Makefile.am index d861438..37c5c93 100644 --- a/sfxr/Makefile.am +++ b/sfxr/Makefile.am @@ -7,4 +7,4 @@ LDFLAGS=`sdl-config --libs` bin_PROGRAMS = sfxr -sfxr_SOURCES := main.cpp sdlkit.cpp tools.cpp sdlkit.h tools.h +sfxr_SOURCES := source/main.cpp source/sdlkit.cpp source/tools.cpp source/sdlkit.h source/tools.h diff --git a/sfxr/Makefile.backup b/sfxr/Makefile.backup deleted file mode 100644 index fcc54f4..0000000 --- a/sfxr/Makefile.backup +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2007 mjau/GerryJJ -# -# 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. - -CFLAGS=-ggdb -CXXFLAGS=$(CFLAGS) `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags` -LDFLAGS=`sdl-config --libs` `pkg-config gtk+-2.0 --libs` - -sfxr: main.cpp tools.h sdlkit.h - $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ - -install: sfxr - mkdir -p $(DESTDIR)/usr/bin - mkdir -p $(DESTDIR)/usr/share/sfxr - mkdir -p $(DESTDIR)/usr/share/applications - mkdir -p $(DESTDIR)/usr/share/icons/hicolor/48x48/apps - mkdir -p $(DESTDIR)/usr/share/man/man1 - install -m 755 sfxr $(DESTDIR)/usr/bin - install -m 644 -p *.tga *.bmp $(DESTDIR)/usr/share/sfxr - install -p -m 644 sfxr.png \ - $(DESTDIR)/usr/share/icons/hicolor/48x48/apps - desktop-file-install --vendor "" \ - --dir $(DESTDIR)/usr/share/applications sfxr.desktop - install -m 644 -p sfxr.1 $(DESTDIR)/usr/share/man/man1 - -clean: - rm -f sfxr diff --git a/sfxr/Makefile.orig b/sfxr/Makefile.orig deleted file mode 100644 index c240872..0000000 --- a/sfxr/Makefile.orig +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2007 mjau/GerryJJ -# -# 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. - -CFLAGS=-ggdb -CXXFLAGS=$(CFLAGS) `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags` -LDFLAGS=`sdl-config --libs` `pkg-config gtk+-2.0 --libs` - -sfxr: main.cpp tools.h sdlkit.h - $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@ - -install: sfxr - mkdir -p $(DESTDIR)/usr/bin - mkdir -p $(DESTDIR)/usr/share/sfxr - mkdir -p $(DESTDIR)/usr/share/applications - mkdir -p $(DESTDIR)/usr/share/icons/hicolor/48x48/apps - install -m 755 sfxr $(DESTDIR)/usr/bin - install -m 644 -p *.tga *.bmp $(DESTDIR)/usr/share/sfxr - install -p -m 644 sfxr.png \ - $(DESTDIR)/usr/share/icons/hicolor/48x48/apps - desktop-file-install --vendor "" \ - --dir $(DESTDIR)/usr/share/applications sfxr.desktop - -clean: - rm sfxr diff --git a/sfxr/readme.txt b/sfxr/README.txt similarity index 100% rename from sfxr/readme.txt rename to sfxr/README.txt diff --git a/sfxr/configure.ac b/sfxr/configure.ac index 387a7e6..9b98fad 100644 --- a/sfxr/configure.ac +++ b/sfxr/configure.ac @@ -6,8 +6,7 @@ AC_INIT([sfxr], [1.2.0], [grimfang4@gmail.com],[sfxr-1.2.0.tar],[http://code.goo AM_INIT_AUTOMAKE(sfxr, 1.2.0) AM_CONFIG_HEADER(config.h:config.in) -AC_CONFIG_SRCDIR([sdlkit.h]) -# AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_SRCDIR([source/sdlkit.h]) # Checks for programs. @@ -33,8 +32,6 @@ AC_FUNC_ERROR_AT_LINE AC_FUNC_MALLOC AC_CHECK_FUNCS([atexit memset pow]) -#AC_CONFIG_FILES([Makefile]) - AC_OUTPUT(Makefile) diff --git a/sfxr/sfxr.1 b/sfxr/data/sfxr.1 similarity index 100% rename from sfxr/sfxr.1 rename to sfxr/data/sfxr.1 diff --git a/sfxr/sfxr.desktop b/sfxr/data/sfxr.desktop similarity index 100% rename from sfxr/sfxr.desktop rename to sfxr/data/sfxr.desktop diff --git a/sfxr/font.tga b/sfxr/images/font.tga similarity index 100% rename from sfxr/font.tga rename to sfxr/images/font.tga diff --git a/sfxr/ld48.tga b/sfxr/images/ld48.tga similarity index 100% rename from sfxr/ld48.tga rename to sfxr/images/ld48.tga diff --git a/sfxr/sfxr.bmp b/sfxr/images/sfxr.bmp similarity index 100% rename from sfxr/sfxr.bmp rename to sfxr/images/sfxr.bmp diff --git a/sfxr/sfxr.png b/sfxr/images/sfxr.png similarity index 100% rename from sfxr/sfxr.png rename to sfxr/images/sfxr.png diff --git a/sfxr/install.txt b/sfxr/install.txt deleted file mode 100644 index 4a3f001..0000000 --- a/sfxr/install.txt +++ /dev/null @@ -1,8 +0,0 @@ -To build and install under Linux do: -make -su -c "make install" - -Note the install is hardcoded to /usr, you can also run sfxr from the build -dir after make (./sfxr). - -The Makefile understands the usual CFLAGS and DESTDIR parameters diff --git a/sfxr/main.cpp b/sfxr/source/main.cpp similarity index 94% rename from sfxr/main.cpp rename to sfxr/source/main.cpp index 506d84c..dc5a561 100644 --- a/sfxr/main.cpp +++ b/sfxr/source/main.cpp @@ -1323,22 +1323,22 @@ void ddkInit() ddkSetMode(640,480, 32, 60, DDK_WINDOW, "sfxr"); // requests window size etc from ddrawkit - if (LoadTGA(font, "/usr/share/sfxr/font.tga")) { + if (LoadTGA(font, "/usr/local/share/sfxr/images/font.tga")) { /* Try again in cwd */ - if (LoadTGA(font, "font.tga")) { + if (LoadTGA(font, "images/font.tga")) { fprintf(stderr, - "Error could not open /usr/share/sfxr/font.tga" - " nor font.tga\n"); + "Error could not open /usr/local/share/sfxr/images/font.tga" + " nor images/font.tga\n"); exit(1); } } - if (LoadTGA(ld48, "/usr/share/sfxr/ld48.tga")) { + if (LoadTGA(ld48, "/usr/local/share/sfxr/images/ld48.tga")) { /* Try again in cwd */ - if (LoadTGA(ld48, "ld48.tga")) { + if (LoadTGA(ld48, "images/ld48.tga")) { fprintf(stderr, - "Error could not open /usr/share/sfxr/ld48.tga" - " nor ld48.tga\n"); + "Error could not open /usr/local/share/sfxr/images/ld48.tga" + " nor images/ld48.tga\n"); exit(1); } } diff --git a/sfxr/sdlkit.cpp b/sfxr/source/sdlkit.cpp similarity index 98% rename from sfxr/sdlkit.cpp rename to sfxr/source/sdlkit.cpp index 266e689..2d125b0 100644 --- a/sfxr/sdlkit.cpp +++ b/sfxr/source/sdlkit.cpp @@ -381,9 +381,9 @@ void sdlinit () { SDL_Surface *icon; VERIFY(!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)); - icon = SDL_LoadBMP("/usr/share/sfxr/sfxr.bmp"); + icon = SDL_LoadBMP("/usr/local/share/sfxr/images/sfxr.bmp"); if (!icon) - icon = SDL_LoadBMP("sfxr.bmp"); + icon = SDL_LoadBMP("images/sfxr.bmp"); if (icon) SDL_WM_SetIcon(icon, NULL); atexit(sdlquit); diff --git a/sfxr/sdlkit.h b/sfxr/source/sdlkit.h similarity index 100% rename from sfxr/sdlkit.h rename to sfxr/source/sdlkit.h diff --git a/sfxr/tools.cpp b/sfxr/source/tools.cpp similarity index 100% rename from sfxr/tools.cpp rename to sfxr/source/tools.cpp diff --git a/sfxr/tools.h b/sfxr/source/tools.h similarity index 100% rename from sfxr/tools.h rename to sfxr/source/tools.h