Reorganized the main directory.

This commit is contained in:
grimfang4@gmail.com
2012-01-11 14:24:07 +00:00
parent 10e2ebda95
commit 23fa8cd480
21 changed files with 81 additions and 118 deletions

View File

@@ -20,3 +20,5 @@ sfxr-sdl-1.2.0
* Sound now plays when an attribute is clicked (a more involved change, like looping, would be needed for dragging) * 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 * Sound now plays on waveform change
* Very simple undo (one slider change) with Z * Very simple undo (one slider change) with Z
* Removed GTK save/load dialog
* Added CMake build

View File

@@ -25,24 +25,24 @@ find_package(SDL REQUIRED)
include_directories(include ${SDL_INCLUDE_DIR}) include_directories(include ${SDL_INCLUDE_DIR})
link_libraries(${SDL_LIBRARY}) link_libraries(${SDL_LIBRARY})
add_definitions("-Wall -pedantic") add_definitions("-Wall --pedantic -O2")
set(SRC_FILES set(SRC_FILES
main.cpp source/main.cpp
sdlkit.cpp source/sdlkit.cpp
tools.cpp source/tools.cpp
) )
add_executable(sfxr ${SRC_FILES}) add_executable(sfxr ${SRC_FILES})
install(TARGETS sfxr install(TARGETS sfxr
RUNTIME DESTINATION .) RUNTIME DESTINATION bin)
install(FILES font.tga ld48.tga sfxr.bmp readme.txt install(FILES images/font.tga images/ld48.tga images/sfxr.bmp
DESTINATION share/sfxr) DESTINATION share/sfxr/images)
install(FILES sfxr.png install(FILES images/sfxr.png
DESTINATION share/icons/hicolor/48x48/apps) DESTINATION share/icons/hicolor/48x48/apps)
install(FILES sfxr.1 install(FILES data/sfxr.1
DESTINATION share/man/man1) DESTINATION share/man/man1)
install(FILES sfxr.desktop install(FILES data/sfxr.desktop
DESTINATION share/applications) DESTINATION share/applications)

16
sfxr/INSTALL.txt Normal file
View File

@@ -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.

40
sfxr/LICENSE.txt Normal file
View File

@@ -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.

View File

@@ -7,4 +7,4 @@ LDFLAGS=`sdl-config --libs`
bin_PROGRAMS = sfxr 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

View File

@@ -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

View File

@@ -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

View File

@@ -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_INIT_AUTOMAKE(sfxr, 1.2.0)
AM_CONFIG_HEADER(config.h:config.in) AM_CONFIG_HEADER(config.h:config.in)
AC_CONFIG_SRCDIR([sdlkit.h]) AC_CONFIG_SRCDIR([source/sdlkit.h])
# AC_CONFIG_HEADERS([config.h])
# Checks for programs. # Checks for programs.
@@ -33,8 +32,6 @@ AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC AC_FUNC_MALLOC
AC_CHECK_FUNCS([atexit memset pow]) AC_CHECK_FUNCS([atexit memset pow])
#AC_CONFIG_FILES([Makefile])
AC_OUTPUT(Makefile) AC_OUTPUT(Makefile)

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 890 B

View File

@@ -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

View File

@@ -1323,22 +1323,22 @@ void ddkInit()
ddkSetMode(640,480, 32, 60, DDK_WINDOW, "sfxr"); // requests window size etc from ddrawkit 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 */ /* Try again in cwd */
if (LoadTGA(font, "font.tga")) { if (LoadTGA(font, "images/font.tga")) {
fprintf(stderr, fprintf(stderr,
"Error could not open /usr/share/sfxr/font.tga" "Error could not open /usr/local/share/sfxr/images/font.tga"
" nor font.tga\n"); " nor images/font.tga\n");
exit(1); exit(1);
} }
} }
if (LoadTGA(ld48, "/usr/share/sfxr/ld48.tga")) { if (LoadTGA(ld48, "/usr/local/share/sfxr/images/ld48.tga")) {
/* Try again in cwd */ /* Try again in cwd */
if (LoadTGA(ld48, "ld48.tga")) { if (LoadTGA(ld48, "images/ld48.tga")) {
fprintf(stderr, fprintf(stderr,
"Error could not open /usr/share/sfxr/ld48.tga" "Error could not open /usr/local/share/sfxr/images/ld48.tga"
" nor ld48.tga\n"); " nor images/ld48.tga\n");
exit(1); exit(1);
} }
} }

View File

@@ -381,9 +381,9 @@ void sdlinit ()
{ {
SDL_Surface *icon; SDL_Surface *icon;
VERIFY(!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)); 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) if (!icon)
icon = SDL_LoadBMP("sfxr.bmp"); icon = SDL_LoadBMP("images/sfxr.bmp");
if (icon) if (icon)
SDL_WM_SetIcon(icon, NULL); SDL_WM_SetIcon(icon, NULL);
atexit(sdlquit); atexit(sdlquit);