├── src ├── include │ ├── CMakeLists.txt │ ├── config.h │ ├── dj.h │ └── globals.h.in ├── CMakeLists.txt ├── menu │ ├── po │ │ ├── Makefile │ │ ├── jumpnbump-menu.pot │ │ └── fr.po │ ├── README.md │ ├── Makefile │ └── jumpnbump_menu.py.pre ├── sdl │ ├── CMakeLists.txt │ ├── filter.h │ ├── jumpnbump32.xpm │ ├── input.c │ ├── jumpnbump64.xpm │ ├── interrpt.c │ ├── filter.c │ ├── sound.c │ └── jumpnbump128.xpm ├── tools │ ├── CMakeLists.txt │ ├── jnbunpack.c │ ├── jnbpack.c │ └── gobpack.c └── game │ ├── CMakeLists.txt │ └── network.h ├── data ├── bump.mod ├── fly.smp ├── font.pcx ├── jump.mod ├── jump.smp ├── mask.pcx ├── menu.pcx ├── calib.dat ├── death.smp ├── level.pcx ├── numbers.pcx ├── objects.pcx ├── rabbit.pcx ├── scores.mod ├── splash.smp ├── spring.smp ├── menumask.pcx ├── pack.bat ├── levelmap.txt ├── numbers.txt ├── CMakeLists.txt ├── rabbit.txt ├── objects.txt └── font.txt ├── dist ├── jumpnbump.ico ├── jumpnbump.png ├── screenshot.png ├── CMakeLists.txt ├── jumpnbump.desktop ├── jumpnbump-menu.desktop ├── jumpnbump.appdata.xml └── jumpnbump.6 ├── docs ├── jumpnbump.html ├── levelmaking │ ├── level.pcx │ ├── pack.gif │ ├── making1.gif │ ├── making2.gif │ └── making3.gif ├── LINKS ├── gob.txt ├── original_readme.txt └── source_release.txt ├── .gitmodules ├── .gitignore ├── .github └── workflows │ ├── clang-format-check.yml │ └── cmake.yml ├── .clang-format ├── CMakeLists.txt ├── AUTHORS ├── README.md ├── ChangeLog └── COPYING /src/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(globals.h.in globals.h @ONLY) 2 | -------------------------------------------------------------------------------- /data/bump.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/bump.mod -------------------------------------------------------------------------------- /data/fly.smp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/fly.smp -------------------------------------------------------------------------------- /data/font.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/font.pcx -------------------------------------------------------------------------------- /data/jump.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/jump.mod -------------------------------------------------------------------------------- /data/jump.smp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/jump.smp -------------------------------------------------------------------------------- /data/mask.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/mask.pcx -------------------------------------------------------------------------------- /data/menu.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/menu.pcx -------------------------------------------------------------------------------- /data/calib.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/calib.dat -------------------------------------------------------------------------------- /data/death.smp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/death.smp -------------------------------------------------------------------------------- /data/level.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/level.pcx -------------------------------------------------------------------------------- /data/numbers.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/numbers.pcx -------------------------------------------------------------------------------- /data/objects.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/objects.pcx -------------------------------------------------------------------------------- /data/rabbit.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/rabbit.pcx -------------------------------------------------------------------------------- /data/scores.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/scores.mod -------------------------------------------------------------------------------- /data/splash.smp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/splash.smp -------------------------------------------------------------------------------- /data/spring.smp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/spring.smp -------------------------------------------------------------------------------- /data/menumask.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/data/menumask.pcx -------------------------------------------------------------------------------- /dist/jumpnbump.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/dist/jumpnbump.ico -------------------------------------------------------------------------------- /dist/jumpnbump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/dist/jumpnbump.png -------------------------------------------------------------------------------- /dist/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/dist/screenshot.png -------------------------------------------------------------------------------- /docs/jumpnbump.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/jumpnbump.html -------------------------------------------------------------------------------- /docs/levelmaking/level.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/levelmaking/level.pcx -------------------------------------------------------------------------------- /docs/levelmaking/pack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/levelmaking/pack.gif -------------------------------------------------------------------------------- /docs/levelmaking/making1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/levelmaking/making1.gif -------------------------------------------------------------------------------- /docs/levelmaking/making2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/levelmaking/making2.gif -------------------------------------------------------------------------------- /docs/levelmaking/making3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rndtrash/jumpnbump/master/docs/levelmaking/making3.gif -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cmake"] 2 | path = cmake 3 | url = https://github.com/aminosbh/sdl2-cmake-modules.git 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generic files to ignore 2 | *~ 3 | .directory 4 | .DS_Store 5 | 6 | # CMake directory 7 | build 8 | 9 | # Jump 'n Bump generated files 10 | #menu/jumpnbump_menu.py 11 | #menu/po/*.mo 12 | -------------------------------------------------------------------------------- /docs/LINKS: -------------------------------------------------------------------------------- 1 | http://www.icculus.org/jumpnbump/ 2 | http://brainchilddesign.com/ 3 | https://web-beta.archive.org/web/20080223055443/http://jumpbump.mine.nu:80/ 4 | http://freshmeat.net/projects/jumpnbump/ 5 | http://gohanz.www7.50megs.com/jumpbump/ 6 | https://www.libsdl.org/ 7 | -------------------------------------------------------------------------------- /data/pack.bat: -------------------------------------------------------------------------------- 1 | cd %1 2 | %2 font 3 | %2 rabbit 4 | %2 numbers 5 | %2 objects 6 | %3 -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp 7 | -------------------------------------------------------------------------------- /dist/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES jumpnbump.appdata.xml DESTINATION ${DATADIR}/metainfo) 2 | install(FILES jumpnbump.desktop DESTINATION ${DATADIR}/applications) 3 | install(FILES jumpnbump.png DESTINATION ${DATADIR}/icons) 4 | install(FILES jumpnbump.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) 5 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #menu 2 | add_subdirectory(include) 3 | include_directories(${CMAKE_BINARY_DIR}/src/include) 4 | include_directories(include) 5 | 6 | if(USE_SDL) 7 | add_subdirectory(sdl) 8 | endif() 9 | 10 | add_subdirectory(game) 11 | if(NOT PLATFORM_PSP) 12 | add_subdirectory(tools) 13 | endif() 14 | -------------------------------------------------------------------------------- /dist/jumpnbump.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Jump 'n Bump 3 | Comment=Cute multiplayer platform game with exploding fluffy bunnies 4 | GenericName=Arcade game with bunnies 5 | Exec=jumpnbump 6 | Icon=jumpnbump 7 | Terminal=false 8 | Type=Application 9 | Categories=Game;ArcadeGame; 10 | Keywords=cute;game;bunnies;rabbits;jump;head;explode;gore; 11 | -------------------------------------------------------------------------------- /dist/jumpnbump-menu.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Jump 'n Bump Menu 3 | Comment=Level selection and config menu for the Jump 'n Bump game 4 | GenericName=Launcher for Jump 'n Bump 5 | Exec=jumpnbump-menu 6 | Icon=jumpnbump 7 | Terminal=false 8 | Type=Application 9 | Categories=Game;ArcadeGame; 10 | Keywords=cute;game;bunnies;rabbits;jump;head;explode;gore; 11 | -------------------------------------------------------------------------------- /data/levelmap.txt: -------------------------------------------------------------------------------- 1 | 1110000000000000000000 2 | 1000000000001000011000 3 | 1000111100001100000000 4 | 1000000000011110000011 5 | 1100000000111000000001 6 | 1110001111110000000001 7 | 1000000000000011110001 8 | 1000000000000000000011 9 | 1110011100000000000111 10 | 1000000000003100000001 11 | 1000000000031110000001 12 | 1011110000311111111001 13 | 1000000000000000000001 14 | 1100000000000000000011 15 | 2222222214000001333111 16 | 1111111111111111111111 -------------------------------------------------------------------------------- /.github/workflows/clang-format-check.yml: -------------------------------------------------------------------------------- 1 | name: clang-format Check 2 | on: [push, pull_request] 3 | jobs: 4 | formatting-check: 5 | name: Formatting Check 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - name: Run clang-format style check for C/C++/Protobuf programs. 10 | uses: jidicula/clang-format-action@v4.8.0 11 | with: 12 | clang-format-version: '13' 13 | check-path: 'src' 14 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | --- 4 | Language: Cpp 5 | UseTab: ForContinuationAndIndentation 6 | TabWidth: 4 7 | IndentWidth: 4 8 | AllowShortIfStatementsOnASingleLine: false 9 | ColumnLimit: 0 10 | BreakBeforeBraces: Linux 11 | SpaceAfterCStyleCast: true 12 | IndentCaseLabels: true 13 | ... 14 | -------------------------------------------------------------------------------- /src/menu/po/Makefile: -------------------------------------------------------------------------------- 1 | DESTDIR ?= 2 | PREFIX ?= /usr/local 3 | DATADIR ?= $(PREFIX)/share 4 | 5 | LANGS = $(subst .po,,$(wildcard *.po)) 6 | MOS = $(subst .po,.mo,$(wildcard *.po)) 7 | 8 | all: $(MOS) 9 | 10 | clean: 11 | rm -f $(MOS) 12 | 13 | install: 14 | for lang in $(LANGS) ; do \ 15 | install -D -m 0644 $$lang.mo $(DESTDIR)$(DATADIR)/locale/$$lang/LC_MESSAGES/jumpnbump-menu.mo ; \ 16 | done 17 | 18 | uninstall: 19 | for lang in $(LANGS) ; do \ 20 | rm $(DESTDIR)$(DATADIR)/locale/$$lang/LC_MESSAGES/jumpnbump-menu.mo ; \ 21 | done 22 | 23 | %.mo: %.po 24 | msgfmt -o $@ $< 25 | -------------------------------------------------------------------------------- /src/sdl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sdl STATIC "") 2 | 3 | find_package(SDL2 REQUIRED) 4 | 5 | set(SDL_HEADERS 6 | filter.h 7 | ) 8 | 9 | set(SDL_SOURCES 10 | filter.c 11 | gfx.c 12 | input.c 13 | interrpt.c 14 | sound.c 15 | ) 16 | 17 | target_sources(sdl 18 | PRIVATE 19 | ${SDL_HEADERS} 20 | ${SDL_SOURCES} 21 | ) 22 | 23 | target_link_libraries(sdl 24 | PUBLIC 25 | SDL2::Core 26 | SDL2::Main 27 | ) 28 | 29 | if(USE_SDL_MIXER) 30 | find_package(SDL2_mixer REQUIRED) 31 | target_link_libraries(sdl 32 | PUBLIC 33 | SDL2::Mixer 34 | ) 35 | endif() 36 | -------------------------------------------------------------------------------- /src/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(gobpack) 2 | 3 | target_compile_features(gobpack 4 | PRIVATE 5 | c_std_17 6 | ) 7 | 8 | target_sources(gobpack 9 | PRIVATE 10 | gobpack.c 11 | ) 12 | 13 | install(TARGETS gobpack DESTINATION ${CMAKE_INSTALL_BINDIR}) 14 | 15 | ### 16 | 17 | add_executable(jnbpack) 18 | 19 | target_compile_features(gobpack 20 | PRIVATE 21 | c_std_17 22 | ) 23 | 24 | target_sources(jnbpack 25 | PRIVATE 26 | jnbpack.c 27 | ) 28 | 29 | install(TARGETS jnbpack DESTINATION ${CMAKE_INSTALL_BINDIR}) 30 | 31 | ### 32 | 33 | add_executable(jnbunpack) 34 | 35 | target_compile_features(gobpack 36 | PRIVATE 37 | c_std_17 38 | ) 39 | 40 | target_sources(jnbunpack 41 | PRIVATE 42 | jnbunpack.c 43 | ) 44 | 45 | install(TARGETS jnbunpack DESTINATION ${CMAKE_INSTALL_BINDIR}) 46 | -------------------------------------------------------------------------------- /data/numbers.txt: -------------------------------------------------------------------------------- 1 | num_images: 10 2 | 3 | image: 1 4 | x: 0 5 | y: 0 6 | width: 16 7 | height: 22 8 | hotspot_x: 0 9 | hotspot_y: 0 10 | 11 | image: 2 12 | x: 18 13 | y: 0 14 | width: 16 15 | height: 22 16 | hotspot_x: 0 17 | hotspot_y: 0 18 | 19 | image: 3 20 | x: 36 21 | y: 0 22 | width: 16 23 | height: 22 24 | hotspot_x: 0 25 | hotspot_y: 0 26 | 27 | image: 4 28 | x: 54 29 | y: 0 30 | width: 16 31 | height: 22 32 | hotspot_x: 0 33 | hotspot_y: 0 34 | 35 | image: 5 36 | x: 72 37 | y: 0 38 | width: 16 39 | height: 22 40 | hotspot_x: 0 41 | hotspot_y: 0 42 | 43 | image: 6 44 | x: 90 45 | y: 0 46 | width: 16 47 | height: 22 48 | hotspot_x: 0 49 | hotspot_y: 0 50 | 51 | image: 7 52 | x: 108 53 | y: 0 54 | width: 16 55 | height: 22 56 | hotspot_x: 0 57 | hotspot_y: 0 58 | 59 | image: 8 60 | x: 126 61 | y: 0 62 | width: 16 63 | height: 22 64 | hotspot_x: 0 65 | hotspot_y: 0 66 | 67 | image: 9 68 | x: 144 69 | y: 0 70 | width: 16 71 | height: 22 72 | hotspot_x: 0 73 | hotspot_y: 0 74 | 75 | image: 10 76 | x: 162 77 | y: 0 78 | width: 16 79 | height: 22 80 | hotspot_x: 0 81 | hotspot_y: 0 82 | 83 | -------------------------------------------------------------------------------- /src/menu/README.md: -------------------------------------------------------------------------------- 1 | # Jump 'n Bump Menu 2 | 3 | Launcher GUI in Python/GTK+3 for Jump 'n Bump. It allows setting various 4 | command line options graphically, including loading additional levels 5 | packaged in the standard path (defined by `GAMEDATADIR` in the Makefile), 6 | or in `~/.jumpnbump/levels/`. 7 | 8 | ## Installation 9 | 10 | Jump 'n Bump Menu is best installed together with the main game, using its 11 | Makefile to initialize some packaging-specific constants. 12 | 13 | ## Dependencies 14 | 15 | - Jump 'n Bump 16 | - Python 3 17 | - PyGObject 18 | - Pillow 19 | 20 | ## History 21 | 22 | Jump 'n Bump Menu was written in 2002 by Martin Willemoes Hansen. This 23 | version is derived from the upstream version 0.6, subsequently maintained 24 | by the Debian jumpnbump packagers. 25 | 26 | It was integrated in the main Jump 'n Bump repository in 2017 for the 27 | version 1.60 of the game. 28 | 29 | There exists a Mono/Gtk# version of Jump 'n Bump Menu by its original 30 | author, though only available via archive.org. You can find the latest 31 | tarball on this [GitLab issue](https://gitlab.com/LibreGames/jumpnbump/issues/23). 32 | -------------------------------------------------------------------------------- /src/menu/Makefile: -------------------------------------------------------------------------------- 1 | DESTDIR ?= 2 | PREFIX ?= /usr/local 3 | BINDIR ?= $(PREFIX)/bin 4 | DATADIR ?= $(PREFIX)/share 5 | # Can be overridden to use e.g. /usr/share/games 6 | GAMEDATADIR ?= $(DATADIR) 7 | UNPACKBIN ?= $(BINDIR)/jnbunpack 8 | 9 | all: jumpnbump_menu.py l10n 10 | 11 | jumpnbump_menu.py: 12 | sed -e "s#%%BINDIR%%#$(BINDIR)#g" -e "s#%%DATADIR%%#$(GAMEDATADIR)#g" -e "s#%%UNPACKBIN%%#$(UNPACKBIN)#g" < jumpnbump_menu.py.pre > jumpnbump_menu.py 13 | 14 | l10n: 15 | $(MAKE) -C po all 16 | 17 | clean: 18 | $(RM) jumpnbump_menu.py 19 | 20 | $(MAKE) -C po clean 21 | 22 | install: 23 | install -D -m 644 jumpnbump_menu.glade $(DESTDIR)$(GAMEDATADIR)/jumpnbump/jumpnbump_menu.glade 24 | install -D -m 755 jumpnbump_menu.py $(DESTDIR)$(BINDIR)/jumpnbump-menu 25 | install -D -m 644 ../dist/jumpnbump-menu.desktop $(DESTDIR)$(DATADIR)/applications/jumpnbump-menu.desktop 26 | 27 | $(MAKE) -C po install 28 | 29 | uninstall: 30 | $(RM) $(DESTDIR)$(GAMEDATADIR)/jumpnbump/jumpnbump_menu.glade 31 | $(RM) $(DESTDIR)$(BINDIR)/jumpnbump-menu 32 | $(RM) $(DESTDIR)$(DATADIR)/applications/jumpnbump-menu.desktop 33 | 34 | $(MAKE) -C po uninstall 35 | -------------------------------------------------------------------------------- /src/include/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * config.h 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #ifndef __CONFIG_H 27 | #define __CONFIG_H 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/sdl/filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * filter.h 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #ifndef __FILTER_H__ 27 | #define __FILTER_H__ 28 | 29 | void do_scale2x(unsigned char *src, 30 | int src_width, 31 | int src_height, 32 | unsigned char *dst); 33 | 34 | #endif /* __FILTER_H__ */ 35 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | project(JumpNBump VERSION 1.70.0) 4 | 5 | include(GNUInstallDirs) 6 | 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") 8 | 9 | if (PSP) 10 | set(DATADIR ".") 11 | set(GAMEDATADIR ".") 12 | else() 13 | set(DATADIR ${CMAKE_INSTALL_PREFIX}/share) 14 | set(GAMEDATADIR ${CMAKE_INSTALL_PREFIX}/share) 15 | endif() 16 | 17 | option(USE_SDL "Use SDL2" ON) 18 | if(USE_SDL) 19 | add_definitions(-DUSE_SDL) 20 | endif() 21 | 22 | option(USE_SDL_MIXER "Use SDL2_mixer" ON) 23 | if(USE_SDL_MIXER) 24 | add_definitions(-DUSE_SDL_MIXER) 25 | else() 26 | add_definitions(-DNO_SDL_MIXER) 27 | endif() 28 | 29 | option(USE_NET "Add online multiplayer" ON) 30 | if(USE_NET) 31 | add_definitions(-DUSE_NET) 32 | endif() 33 | 34 | option(ZLIB_SUPPORT "Use zlib" ON) 35 | if(ZLIB_SUPPORT) 36 | add_definitions(-DZLIB_SUPPORT) 37 | endif() 38 | 39 | option(BZLIB_SUPPORT "Use bzlib" ON) 40 | if(BZLIB_SUPPORT) 41 | add_definitions(-DBZLIB_SUPPORT) 42 | endif() 43 | 44 | # Add main target 45 | add_compile_options(-Wall -Wextra -Werror -Wpedantic -Wno-error=unused-but-set-parameter -Wno-error=pedantic -std=gnu17) 46 | 47 | add_subdirectory(src) 48 | add_subdirectory(data) 49 | add_subdirectory(dist) 50 | -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GOBS 2 | font.gob numbers.gob objects.gob rabbit.gob 3 | ) 4 | 5 | list(TRANSFORM GOBS PREPEND ${CMAKE_CURRENT_BINARY_DIR}/) 6 | 7 | set(DATAFILES 8 | bump.mod calib.dat death.smp fly.smp jump.mod 9 | jump.smp levelmap.txt level.pcx mask.pcx menu.pcx 10 | menumask.pcx scores.mod splash.smp spring.smp 11 | ) 12 | 13 | list(TRANSFORM DATAFILES PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/) 14 | 15 | add_custom_command( 16 | OUTPUT font.gob 17 | COMMAND gobpack -o ${CMAKE_CURRENT_BINARY_DIR}/font.gob ${CMAKE_CURRENT_SOURCE_DIR}/font 18 | DEPENDS gobpack font.pcx font.txt 19 | VERBATIM 20 | ) 21 | 22 | add_custom_command( 23 | OUTPUT rabbit.gob 24 | COMMAND gobpack -o ${CMAKE_CURRENT_BINARY_DIR}/rabbit.gob ${CMAKE_CURRENT_SOURCE_DIR}/rabbit 25 | DEPENDS gobpack rabbit.pcx rabbit.txt 26 | VERBATIM 27 | ) 28 | 29 | add_custom_command( 30 | OUTPUT numbers.gob 31 | COMMAND gobpack -o ${CMAKE_CURRENT_BINARY_DIR}/numbers.gob ${CMAKE_CURRENT_SOURCE_DIR}/numbers 32 | DEPENDS gobpack numbers.pcx numbers.txt 33 | VERBATIM 34 | ) 35 | 36 | add_custom_command( 37 | OUTPUT objects.gob 38 | COMMAND gobpack -o ${CMAKE_CURRENT_BINARY_DIR}/objects.gob ${CMAKE_CURRENT_SOURCE_DIR}/objects 39 | DEPENDS gobpack objects.pcx objects.txt 40 | VERBATIM 41 | ) 42 | 43 | add_custom_command( 44 | OUTPUT jumpbump.dat 45 | COMMAND jnbpack -o ${CMAKE_CURRENT_BINARY_DIR}/jumpbump.dat ${DATAFILES} ${GOBS} 46 | DEPENDS jnbpack ${DATAFILES} ${GOBS} 47 | VERBATIM 48 | ) 49 | 50 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jumpbump.dat DESTINATION ${GAMEDATADIR}/jumpnbump) 51 | 52 | add_custom_target(data ALL 53 | DEPENDS jumpbump.dat) 54 | -------------------------------------------------------------------------------- /docs/gob.txt: -------------------------------------------------------------------------------- 1 | THE FORMAT OF GOBFILES 2 | 3 | Do YOU want to make your own GOB-files? 4 | Then you have to know the GOB format! 5 | Here you can find a brief desciption of it. 6 | (this is all about how the file is saved) 7 | Note: Everything is saved in Intel byteorder, 8 | ie the least significant byte first. 9 | 10 | 11 | THE HEADER 12 | 13 | Offset Size Description 14 | 0 2 Number of images in the file 15 | 16 | 17 | For I=1 to Number of images 18 | 19 | Offset Size Description 20 | 2+I*4 4 Offset in file to image data 21 | 22 | End repeat 23 | 24 | 25 | The above offsets are offsets from the beginning of 26 | the file. Each image has it's own image data. 27 | The image data is like this: 28 | 29 | 30 | THE IMAGE DATA 31 | 32 | Offset Size Description 33 | 0 2 Image width in pixels (W) 34 | 2 2 Image height in pixels (H) 35 | 4 2 Hotspot x 36 | 6 2 Hotspot y 37 | 8 W*H Bitmap data 38 | 39 | 40 | The offsets above are offsets in the image data (for each image). 41 | 42 | The Hotspot x/y of a specific image works like this: 43 | Whenever a sprite is drawn at (x, y) with that image, 44 | the image is drawn at (x - hotspot x, y - hotspot y), 45 | where hotspot x/y are the hotspots for that image. 46 | 47 | The bitmap data is just a block of colordata for each pixel. 48 | It scans the image horisontally left/down. This means that 49 | the first byte represents the upper left pixel, the second 50 | represents the pixel to the right of that and so on. 51 | If the width is 10 pixels then the 10th byte of bitmap data 52 | will represent the pixel (0, 1). 53 | -------------------------------------------------------------------------------- /.github/workflows/cmake.yml: -------------------------------------------------------------------------------- 1 | name: CMake 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) 11 | BUILD_TYPE: Release 12 | 13 | jobs: 14 | build: 15 | # The CMake configure and build commands are platform agnostic and should work equally 16 | # well on Windows or Mac. You can convert this to a matrix build if you need 17 | # cross-platform coverage. 18 | # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | with: 24 | submodules: true 25 | 26 | - name: Install SDL2 27 | run: sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev 28 | 29 | - name: Install BZip2 30 | run: sudo apt install libbz2-dev 31 | 32 | - name: Install Zlib 33 | run: sudo apt install zlib1g-dev 34 | 35 | - name: Install Cppcheck 36 | run: sudo apt install cppcheck 37 | 38 | - name: Configure CMake 39 | # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. 40 | # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type 41 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_CPPCHECK:FILEPATH=cppcheck 42 | 43 | - name: Build 44 | # Build your program with the given configuration 45 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} 46 | -------------------------------------------------------------------------------- /src/game/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(jumpnbump) 2 | 3 | install(TARGETS jumpnbump DESTINATION ${CMAKE_INSTALL_BINDIR}) 4 | 5 | set(JNB_HEADERS 6 | network.h 7 | ) 8 | 9 | set(JNB_SOURCES 10 | network.c 11 | main.c 12 | menu.c 13 | ) 14 | 15 | target_sources(jumpnbump 16 | PRIVATE 17 | ${JNB_SOURCES} 18 | ${JNB_HEADERS} 19 | ) 20 | 21 | target_compile_features(jumpnbump 22 | PRIVATE 23 | c_std_17 24 | ) 25 | 26 | target_link_libraries(jumpnbump 27 | PRIVATE 28 | sdl 29 | m 30 | ) 31 | 32 | if (PSP) 33 | target_link_libraries(jumpnbump 34 | PRIVATE 35 | -L${PSPDEV}/psp/lib 36 | # -lg 37 | -lc 38 | -lGLU 39 | -lglut 40 | # -lz 41 | # -lm 42 | -lGL 43 | -lvorbisfile 44 | -lvorbis 45 | -logg 46 | -lmikmod 47 | -L${PSPDEV}/psp/sdk/lib 48 | -L${PSPDEV}/psp 49 | -lc 50 | -lpspvfpu 51 | -lpspgu 52 | -lpspctrl 53 | -lpspge 54 | -lpspdisplay 55 | -lpsphprm 56 | -lpspaudio 57 | # -lpspnet_inet 58 | -lpspvram 59 | ) 60 | 61 | create_pbp_file(TARGET jumpnbump 62 | TITLE [=[Jump \\'n Bump]=] 63 | ICON_PATH NULL 64 | BACKGROUND_PATH NULL 65 | PREVIEW_PATH NULL 66 | # BUILD_PRX 67 | ) 68 | endif() 69 | 70 | target_include_directories(jumpnbump 71 | PRIVATE 72 | ${CMAKE_CURRENT_SOURCE_DIR} 73 | ) 74 | 75 | 76 | if (USE_NET) 77 | find_package(SDL2_net REQUIRED) 78 | target_link_libraries(jumpnbump 79 | PRIVATE 80 | SDL2::Net 81 | ) 82 | endif() 83 | 84 | if(BZLIB_SUPPORT) 85 | find_package(BZip2 REQUIRED) 86 | target_include_directories(jumpnbump 87 | PRIVATE 88 | ${BZIP2_INCLUDE_DIR} 89 | ) 90 | target_link_libraries(jumpnbump 91 | PRIVATE 92 | ${BZIP2_LIBRARIES} 93 | ) 94 | endif() 95 | 96 | if(ZLIB_SUPPORT) 97 | find_package(ZLIB REQUIRED) 98 | target_include_directories(jumpnbump 99 | PRIVATE 100 | ${ZLIB_INCLUDE_DIR} 101 | ) 102 | target_link_libraries(jumpnbump 103 | PRIVATE 104 | ${ZLIB_LIBRARIES} 105 | ) 106 | endif() 107 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jump 'n Bump is done by many people. The authors and contributors are listed 2 | below. Invented and implemented was Jump 'n Bump by Brainchild Design as a 3 | DOS game. Later the source was released and Chuck Mason did the port to 4 | Linux using SDL. Some people contributed various stuff to it. 5 | The current maintainer is Florian Schulze. 6 | 7 | Mattias Brynervall 8 | Original DOS code. 9 | 10 | Andreas Brynervall 11 | Martin Magnusson 12 | Original Graphics. 13 | 14 | Anders Nilsson 15 | Original Music. 16 | 17 | Chuck Mason 18 | The first Linux port using SDL. 19 | 20 | Philippe Brochard 21 | The jbmenu.tcl script. 22 | 23 | Joe Wreschnig 24 | The manual page 25 | 26 | "timecop" 27 | pack and unpack. 28 | 29 | Jon Atkins 30 | The network code of the Linux version. 31 | 32 | Gürkan Sengün 33 | Made the website http://www.jumpbump.mine.nu/ and hosts it. Promotion. 34 | 35 | Florian Schulze 36 | Cleaned up code. Added scaling graphics mode (800x512). Fixed sound. 37 | 38 | Ben Hines 39 | MacOS X fixes. 40 | 41 | Gil Megidish 42 | Made the Kaillera network version. 43 | 44 | David García Rodríguez 45 | Level making tutorial. 46 | 47 | Ryan C. Gordon 48 | Made networking possible again. 49 | 50 | Martin Willemoes Hansen 51 | The jumpnbump_menu Python frontend. 52 | http://mwh.sysrq.dk/programs/programs.phtml 53 | 54 | Alessandro Gatti 55 | FreeBSD fixes. 56 | 57 | Ulrich Eckhardt 58 | Cleanup and small patches for enhanced networking. 59 | 60 | Ricardo Cruz 61 | AI functions 62 | 63 | Fabian Greffrath 64 | Debian patches. 65 | 66 | Côme Chilliet 67 | SDL2 port. 68 | Maintenance from 2015-2017. 69 | 70 | Rémi Verschelde 71 | Packaging fixes and cleanups. 72 | 73 | Ivan Kuzmenko 74 | Makefile to CMake conversion. 75 | -------------------------------------------------------------------------------- /docs/original_readme.txt: -------------------------------------------------------------------------------- 1 | JUMP 'N BUMP 2 | 3 | by Brainchild Design in 1998 4 | 5 | 6 | Jump 'n Bump is e-mailware. That means you're supposed to 7 | send us an e-mail. Write for example where you're from and 8 | what you thought about this game. If you do that, you will 9 | greatly encourage us to make more games for you! 10 | 11 | We encourage you to spread this game to all your friends! 12 | You are also allowed to put this game on your homepage, 13 | on CD:s and magazines. You may even charge money for it. 14 | It would be nice though, if you sent us a copy of your 15 | article, so we know about it. 16 | 17 | 18 | Code by Mattias Brynervall 19 | Graphics by Andreas Brynervall 20 | and Martin Magnusson 21 | Music by Anders Nilsson 22 | 23 | 24 | INSTRUCTIONS 25 | 26 | Leap over the log, and bound off to the right to play. 27 | The different rabbits are controlled with: 28 | 29 | DOTT LEFT/RIGHT/UP 30 | JIFFY A/D/W 31 | FIZZ Mouse Buttons 32 | MIJJI Joystick 33 | 34 | Jump around like crazy and try to get on top of the others. 35 | 36 | 37 | HOMEPAGE 38 | 39 | http://www.algonet.se/~mattiasb 40 | 41 | 42 | BRAINCHILD DESIGN 43 | 44 | Brainchild Design tries to make games with great gameplay. 45 | "Simple but yet addictive" is something of a guideline. 46 | Brainchild Designs members are: 47 | 48 | Andreas Brynervall andreasb@acc.umu.se 49 | Mattias Brynervall matbr656@student.liu.se 50 | Martin Magnusson marma102@student.liu.se 51 | Anders Nilsson equel@swipnet.se 52 | 53 | Andreas, Mattias and Martin are old friends from school in 54 | Nybro, in the south of Sweden. Anders joined a bit later. 55 | He's from Malmö, and we met eachother over the internet. 56 | Now we really don't know where he is, and we have no contact 57 | with him. Where are you, Anders? 58 | 59 | 60 | SECRETS 61 | 62 | Oh, there are some secrets in Jump 'n Bump. 63 | Try and see if you can find them! 64 | If you can't, you could always write and ask us... 65 | 66 | 67 | TECHNICAL INFO 68 | 69 | Program code in C and ASM. Compiled with DJGPP and NASM. 70 | Graphics drawn in Deluxe Paint 2 and Paint Shop Pro 5. 71 | Music made with Fasttracker 2. 72 | Readme written in Notepad. 73 | 74 | 75 | DON'T FORGET TO SEND AN E-MAIL! -------------------------------------------------------------------------------- /src/sdl/jumpnbump32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * jumpnbump_xpm[] = { 3 | "32 32 65 1", 4 | " c None", 5 | ". c #261814", 6 | "+ c #B3B3B2", 7 | "@ c #EC7818", 8 | "# c #747373", 9 | "$ c #B83A18", 10 | "% c #6D6D6B", 11 | "& c #C8C1BB", 12 | "* c #6B3203", 13 | "= c #DB8434", 14 | "- c #E28A32", 15 | "; c #DCCEC6", 16 | "> c #CA7C30", 17 | ", c #A05618", 18 | "' c #2A262A", 19 | ") c #999998", 20 | "! c #F59239", 21 | "~ c #9B4E10", 22 | "{ c #EFE8E4", 23 | "] c #FDB055", 24 | "^ c #AB530B", 25 | "/ c #3A363A", 26 | "( c #8F8E8D", 27 | "_ c #CE6915", 28 | ": c #6A4E3A", 29 | "< c #BEB8B2", 30 | "[ c #EF9A47", 31 | "} c #F4F1F0", 32 | "| c #C0691C", 33 | "1 c #661834", 34 | "2 c #C8A68C", 35 | "3 c #434143", 36 | "4 c #894209", 37 | "5 c #C2610F", 38 | "6 c #F79E3F", 39 | "7 c #848482", 40 | "8 c #504C4C", 41 | "9 c #5E2E06", 42 | "0 c #823E06", 43 | "a c #F6C29E", 44 | "b c #EAB68A", 45 | "c c #967A60", 46 | "d c #D6A67A", 47 | "e c #8B6241", 48 | "f c #B66016", 49 | "g c #FDA542", 50 | "h c #FCFCFD", 51 | "i c #846A54", 52 | "j c #E6A86C", 53 | "k c #ABA7A5", 54 | "l c #BA590C", 55 | "m c #F8DCC2", 56 | "n c #AE9276", 57 | "o c #864C1E", 58 | "p c #585757", 59 | "q c #E0DDDB", 60 | "r c #733403", 61 | "s c #5E3A1E", 62 | "t c #7B7B7B", 63 | "u c #FEAA48", 64 | "v c #F68627", 65 | "w c #F97B13", 66 | "x c #746D6A", 67 | "y c #DAB69E", 68 | "z c #B45A0F", 69 | " ", 70 | " ", 71 | " )) ", 72 | " x (7# ", 73 | " )k p8 (## ", 74 | " k)& ((p3 (%) ", 75 | " }k<< kt(p8 7t( ", 76 | " qq+h b+(+p%)7() ", 77 | " )}{&6y;& 8#t7( ", 78 | " vuuu[q}}bq{;]ppt7(|: ", 79 | " >ugu]kqh{}{&[~3t((tsvwv ", 80 | " ,=]]{hhhhh{-f8p7)px#@vvvvv ", 81 | " ,]]}hhhhhhjo'8t(tp7@vvvvv ", 82 | " ~>j{&{{}hhms.8%t7%cf|w!! ", 83 | " ~__w@@nt})}hhm4./p%%#$*05! ", 84 | " ^@www@=ac ", 90 | " ***9*****~_^-]]]u6=zfi% ", 91 | " ***r**9**l_^^[!=|^^^^x%% ", 92 | " 9********l5z^||^^^^^,##x% ", 93 | " ******r5_l^^^^^^^ex%%x%% ", 94 | " ***r*055fz^^,^e%x####t# ", 95 | " ****0_5l^^,exx%%#%%% ", 96 | " **4555ex%%%%% ", 97 | " *~l %x%## ", 98 | " ", 99 | " ", 100 | " "}; 101 | -------------------------------------------------------------------------------- /dist/jumpnbump.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jumpnbump.desktop 5 | CC0-1.0 6 | GPL-2.0+ 7 | Jump 'n Bump 8 | Cute multiplayer platform game with exploding fluffy bunnies 9 | 10 |

11 | Jump 'n Bump is an arcade multiplayer game for the whole family. 12 | You play cute fluffy little bunnies and hop on each other's heads. 13 |

14 | 15 |

16 | At the beginning you are in the menu, where you have to let each active player 17 | jump over the tree trunk to enter the play area, and then walk to the right. 18 | You will then enter the arena. The aim is to jump on the other bunnies' heads... 19 |

20 |
21 | 22 | intense 23 | intense 24 | none 25 | mild 26 | none 27 | none 28 | none 29 | none 30 | none 31 | none 32 | none 33 | none 34 | none 35 | none 36 | none 37 | none 38 | none 39 | none 40 | none 41 | none 42 | 43 | 44 | 45 | https://gitlab.com/LibreGames/jumpnbump/raw/master/dist/screenshot.png 46 | 47 | 48 | 49 | https://gitlab.com/LibreGames/jumpnbump 50 | rverschelde_AT_gmail.com 51 |
52 | -------------------------------------------------------------------------------- /src/menu/po/jumpnbump-menu.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2009-02-23 22:47+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=CHARSET\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: jumpnbump-menu:46 20 | msgid "Level" 21 | msgstr "" 22 | 23 | #: jumpnbump_menu.glade:8 24 | msgid "Jump 'n Bump menu" 25 | msgstr "" 26 | 27 | #: jumpnbump_menu.glade:41 28 | msgid "_Standalone" 29 | msgstr "" 30 | 31 | #: jumpnbump_menu.glade:60 32 | msgid "_Fireworks" 33 | msgstr "" 34 | 35 | #: jumpnbump_menu.glade:80 36 | msgid "_Client" 37 | msgstr "" 38 | 39 | #: jumpnbump_menu.glade:100 40 | msgid "Ser_ver" 41 | msgstr "" 42 | 43 | #: jumpnbump_menu.glade:121 44 | msgid "Mode" 45 | msgstr "" 46 | 47 | #: jumpnbump_menu.glade:230 48 | msgid "Remote server ip/name" 49 | msgstr "" 50 | 51 | #: jumpnbump_menu.glade:237 jumpnbump_menu.glade:742 52 | msgid "*" 53 | msgstr "" 54 | 55 | #: jumpnbump_menu.glade:251 56 | msgid "Your are player number?" 57 | msgstr "" 58 | 59 | #: jumpnbump_menu.glade:279 60 | msgid "_Number of remote clients:" 61 | msgstr "" 62 | 63 | #: jumpnbump_menu.glade:304 64 | msgid "Rem_ote server:" 65 | msgstr "" 66 | 67 | #: jumpnbump_menu.glade:364 68 | msgid "Network" 69 | msgstr "" 70 | 71 | #: jumpnbump_menu.glade:411 72 | msgid "Fullscr_een" 73 | msgstr "" 74 | 75 | #: jumpnbump_menu.glade:429 76 | msgid "No _gore" 77 | msgstr "" 78 | 79 | #: jumpnbump_menu.glade:447 80 | msgid "_Double resolution" 81 | msgstr "" 82 | 83 | #: jumpnbump_menu.glade:465 84 | msgid "_Mirror level" 85 | msgstr "" 86 | 87 | #: jumpnbump_menu.glade:484 88 | msgid "Graphics" 89 | msgstr "" 90 | 91 | #: jumpnbump_menu.glade:525 92 | msgid "No so_und" 93 | msgstr "" 94 | 95 | #: jumpnbump_menu.glade:543 96 | msgid "No f_lies" 97 | msgstr "" 98 | 99 | #: jumpnbump_menu.glade:561 100 | msgid "_With music but without sound." 101 | msgstr "" 102 | 103 | #: jumpnbump_menu.glade:580 104 | msgid "Sound" 105 | msgstr "" 106 | 107 | #: jumpnbump_menu.glade:671 108 | msgid "_Run" 109 | msgstr "" 110 | 111 | #: jumpnbump_menu.glade:700 112 | msgid "_About" 113 | msgstr "" 114 | 115 | #: jumpnbump_menu.glade:719 116 | msgid "About" 117 | msgstr "" 118 | 119 | #: jumpnbump_menu.glade:740 120 | msgid "Jump 'n Bump menu 0.6" 121 | msgstr "" 122 | 123 | #: jumpnbump_menu.glade:755 124 | msgid "" 125 | "Copyright (c) 2002 Martin Willemoes Hansen \n" 126 | "\n" 127 | "Jump 'n Bump starter.\n" 128 | "\n" 129 | "GTK+ and Python rock!!" 130 | msgstr "" 131 | 132 | #: jumpnbump_menu.glade:836 133 | msgid "_Ok" 134 | msgstr "" 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jump 'n Bump 2 | 3 | ![Screenshot](/dist/screenshot.png "Screenshot") 4 | 5 | This is a game for the whole family. You play cute fluffy little bunnies and 6 | hop on each other's heads. 7 | 8 | At the beginning you are in the menu, where you have to let each active player 9 | jump over the tree trunk to enter the play area, and then walk to the right. 10 | You will then enter the arena. The aim is to jump on the other bunnies' heads… 11 | 12 | Jump 'n Bump was originally a DOS game by Brainchild Design, which was open 13 | sourced under the GPL license and ported to SDL, and then SDL2. 14 | 15 | ## Controls 16 | 17 | The controls are keyboard layout-independent, which means that regardless of 18 | the layout that you are using (e.g. AZERTY or Dvorak), they are located as if 19 | it were QWERTY. 20 | 21 | The controls on a **QWERTY** keyboard are: 22 | 23 | - A, W, D to steer Dot 24 | - ←, ↑, → to steer Jiffy 25 | - J, I, L to steer Fizz 26 | - 4, 8, 6 to steer Mijji (on the numeric pad) 27 | 28 | You can also use joysticks (main axis and button 1 will be used). 29 | 30 | - F10 toggles fullscreen 31 | - ESC ends the game 32 | - F12 closes the game and quits 33 | 34 | ## Extra levels 35 | 36 | Additional levels are available on the website of 37 | [Brainchild Design](http://www.brainchilddesign.com/games/jumpnbump/levels/levels1.html). 38 | You can launch them with `jumpnbump -dat levelname.dat`. 39 | 40 | ## Networking 41 | 42 | Jump 'n Bump can be played in multiplayer over the network. This can be done 43 | with these commands: 44 | 45 | Player 1: `jumpnbump -server 1` 46 | Player 2: `jumpnbump -connect ` 47 | 48 | You have to make sure that the port tcp/11111 is open in your firewall. 49 | 50 | You can add -server 2 and -server 3 for 3rd and 4th player, and make sure that all 51 | the players are using the same `-dat level.dat`, if any. 52 | 53 | ## Compilation 54 | 55 | Clone this repo and pull all the submodules with 56 | `git clone --recurse-submodules https://github.com/rndtrash/jumpnbump.git` 57 | 58 | To build Jump 'n Bump you will need development libraries for the SDL2, SDL2_mixer, SDL2_net, 59 | BZip2 and Zlib, as well as CMake to generate the Makefiles. 60 | 61 | You can then run `cmake -B build` in the root of the repo to configure this project into `build` folder and either 62 | run `cmake --build build` or go to the `build` folder and run `make`. 63 | 64 | Jump 'n Bump has the following options available for CMake that can be used with 65 | `cmake -B build -DPARAM=ON -DOTHERPARAM=OFF`: 66 | 67 | |Option|Description|Default value| 68 | |------|-----------|-------------| 69 | |DATADIR|The folder where data such as desktop icons and shortcuts is stored.|`${CMAKE_INSTALL_PREFIX}/share`| 70 | |GAMEDATADIR|The folder where game data is stored.|`${CMAKE_INSTALL_PREFIX}/share`| 71 | |USE_SDL|Use SDL2. At the moment there is no point in disabling it.|ON| 72 | |USE_SDL_MIXER|Use SDL2 mixer.|ON| 73 | |USE_NET|Add online multiplayer. Requires SDL2 net.|ON| 74 | |ZLIB_SUPPORT|Use Zlib.|ON| 75 | |BZLIB_SUPPORT|Use BZip2.|ON| 76 | 77 | You can install the project with `cmake --install build` or `make install` in the `build` folder. May require root depending on your installation prefix. 78 | 79 | ## License 80 | 81 | Jump 'n Bump is distributed under the GNU General Public License, version 2, or 82 | (at your option) any later version (GPL-2.0+). See the AUTHORS file for 83 | credits. 84 | -------------------------------------------------------------------------------- /docs/source_release.txt: -------------------------------------------------------------------------------- 1 | JUMP 'N BUMP 2 | 3 | Source Code Release 4 | by Brainchild Design in 99 5 | 6 | 7 | Ok, enough already! Too many people have been 8 | asking about the source code for Jump 'n Bump, 9 | but I've always said that it's messy and ugly 10 | and bad, and besides, nobody could really learn 11 | anything from it, certainly not how to design 12 | code. 13 | 14 | Then I remembered how excited I was when I got 15 | hold of the source code to Wolfenstein 3D by 16 | ID. Not that I really learned that much from 17 | it, it was far too complex for me at that time. 18 | That is also the reason that I don't care 19 | about source code. It takes far too long time 20 | to understand what happens, and I personally 21 | don't think it's worth it. 22 | 23 | Again, I thought about it for a while. And I 24 | can't say that there is that much source code 25 | for complete games out there. Mostly it's just 26 | "how to make this neat effect". Nothing wrong 27 | with that, it's just that there's so much more 28 | to making a game than that! 29 | 30 | So I finally decided to release the code. Do 31 | whatever you like with it. I've gotten e-mails 32 | saying things like "if I got the source, I could 33 | add multiplayer support over the internet". 34 | Yeah, right! Adding that would probably be 35 | harder than to totally rewrite the game. The 36 | code is poorly designed, making changes to is 37 | hard, if not impossible. Be warned! 38 | 39 | If I still haven't convinced you to stay away, 40 | then I would be glad to see what you manage 41 | to do with it. Some suggestions I've gotten for 42 | the game includes computer rabbits, network 43 | support, better menu with level-loading support, 44 | and so on. Oh, and 400x256 is NOT a good 45 | resolution, I can tell you that much. 46 | 47 | You'll need DJGPP to compile the code. You can 48 | find it on http://www.delorie.com. I recommend 49 | that you also get hold of RHIDE, a great IDE. 50 | If you need to recompile the ASM code, you will 51 | need NASM, which you can find on 52 | http://www.web-sites.co.uk/nasm/ 53 | 54 | Ok, here's a short explanation on how to get 55 | it to compile (I won't explain how to install 56 | DJGPP and RHIDE, there's plenty of info on that 57 | on the net): 58 | 59 | Move 'libdj.a' to DJGPP's LIB-directory and 60 | 'dj.h' to DJGPP's INCLUDE-directory. 61 | 62 | Start up RHIDE, and try opening the project 63 | 'jumpbump.gpr'. If that works then you'll be 64 | all set and ready to compile. If not, try 65 | setting all the directories in the project 66 | right, and so on. 67 | 68 | If you can't open the project, delete 69 | 'jumpbump.gpr' and 'jumpbump.gdt'. Start up 70 | RHIDE and create a new project. Add all *.o 71 | files and 'gfx.obj'. (The reason I add the 72 | object files instead of the source files is 73 | that my RHIDE always recompiled everything, 74 | not just what was changed.) Go into Local 75 | Options for 'gfx.obj' and change Name of the 76 | output file to 'gfx.obj'. In the menu, go for 77 | Options->Libraries. Write 'dj' on the first 78 | row, and put an X to the left of it. Now you 79 | should be able to compile. 80 | 81 | Oh, and please don't write to me and ask about 82 | the code. It was almost a year since I wrote it, 83 | and I really don't remember anything about it. 84 | 85 | Of course, I don't take any responsibility 86 | whatsoever to what might happen to you, your 87 | computer or your social life if you choose to 88 | use this. 89 | 90 | 'Nuff said! 91 | 92 | Mattias Brynervall, Brainchild Design 93 | http://www.brainchilddesign.com -------------------------------------------------------------------------------- /src/menu/po/fr.po: -------------------------------------------------------------------------------- 1 | # French translations for jumpnbump package 2 | # Traductions françaises du paquet jumpnbump. 3 | # Copyright (C) 2009 Stéphane Blondon 4 | # This file is distributed under the same license as the PACKAGE package. 5 | # stephane , 2009. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: fr\n" 10 | "Report-Msgid-Bugs-To: stephane.blondon@gmail.com\n" 11 | "POT-Creation-Date: 2009-02-23 22:47+0100\n" 12 | "PO-Revision-Date: 2009-02-23 23:21+0100\n" 13 | "Last-Translator: stephane \n" 14 | "Language-Team: French\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #: jumpnbump-menu:46 21 | msgid "Level" 22 | msgstr "Niveau" 23 | 24 | #: jumpnbump_menu.glade:8 25 | msgid "Jump 'n Bump menu" 26 | msgstr "Jump 'n Bump menu" 27 | 28 | #: jumpnbump_menu.glade:41 29 | msgid "_Standalone" 30 | msgstr "Au_tonome" 31 | 32 | #: jumpnbump_menu.glade:60 33 | msgid "_Fireworks" 34 | msgstr "_Feu d'artifice" 35 | 36 | #: jumpnbump_menu.glade:80 37 | msgid "_Client" 38 | msgstr "_Client" 39 | 40 | #: jumpnbump_menu.glade:100 41 | msgid "Ser_ver" 42 | msgstr "Ser_veur" 43 | 44 | #: jumpnbump_menu.glade:121 45 | msgid "Mode" 46 | msgstr "Mode" 47 | 48 | #: jumpnbump_menu.glade:230 49 | msgid "Remote server ip/name" 50 | msgstr "Serveur distant ip/nom" 51 | 52 | #: jumpnbump_menu.glade:237 jumpnbump_menu.glade:742 53 | msgid "*" 54 | msgstr "*" 55 | 56 | #: jumpnbump_menu.glade:251 57 | msgid "Your are player number?" 58 | msgstr "Votre numéro de joueur" 59 | 60 | #: jumpnbump_menu.glade:279 61 | msgid "_Number of remote clients:" 62 | msgstr "_Nombre de clients distants" 63 | 64 | #: jumpnbump_menu.glade:304 65 | msgid "Rem_ote server:" 66 | msgstr "Serveur _distant" 67 | 68 | #: jumpnbump_menu.glade:364 69 | msgid "Network" 70 | msgstr "Réseau" 71 | 72 | #: jumpnbump_menu.glade:411 73 | msgid "Fullscr_een" 74 | msgstr "Pl_ein écran" 75 | 76 | #: jumpnbump_menu.glade:429 77 | msgid "No _gore" 78 | msgstr "Pas de san_g" 79 | 80 | #: jumpnbump_menu.glade:447 81 | msgid "_Double resolution" 82 | msgstr "Résolution dou_blée" 83 | 84 | #: jumpnbump_menu.glade:465 85 | msgid "_Mirror level" 86 | msgstr "Niveau en _miroir" 87 | 88 | #: jumpnbump_menu.glade:484 89 | msgid "Graphics" 90 | msgstr "Vidéo" 91 | 92 | #: jumpnbump_menu.glade:525 93 | msgid "No so_und" 94 | msgstr "Pas de _son" 95 | 96 | #: jumpnbump_menu.glade:543 97 | msgid "No f_lies" 98 | msgstr "Pas de mouc_hes" 99 | 100 | #: jumpnbump_menu.glade:561 101 | msgid "_With music but without sound." 102 | msgstr "Ave_c musique mais sans son" 103 | 104 | #: jumpnbump_menu.glade:580 105 | msgid "Sound" 106 | msgstr "Son" 107 | 108 | #: jumpnbump_menu.glade:671 109 | msgid "_Run" 110 | msgstr "_Jouer" 111 | 112 | #: jumpnbump_menu.glade:700 113 | msgid "_About" 114 | msgstr "_A propos" 115 | 116 | #: jumpnbump_menu.glade:719 117 | msgid "About" 118 | msgstr "À propos" 119 | 120 | #: jumpnbump_menu.glade:740 121 | msgid "Jump 'n Bump menu 0.6" 122 | msgstr "Jump 'n Bump menu 0.6" 123 | 124 | #: jumpnbump_menu.glade:755 125 | msgid "" 126 | "Copyright (c) 2002 Martin Willemoes Hansen \n" 127 | "\n" 128 | "Jump 'n Bump starter.\n" 129 | "\n" 130 | "GTK+ and Python rock!!" 131 | msgstr "" 132 | "Copyright (c) 2002 Martin Willemoes Hansen \n" 133 | "\n" 134 | "Lanceur pour Jump 'n Bump.\n" 135 | "\n" 136 | "GTK+ et Python, c'est bon !" 137 | 138 | #: jumpnbump_menu.glade:836 139 | msgid "_Ok" 140 | msgstr "_Ok" 141 | -------------------------------------------------------------------------------- /src/game/network.h: -------------------------------------------------------------------------------- 1 | /* 2 | * network.h 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #ifndef __NETWORK_H__ 27 | #define __NETWORK_H__ 28 | 29 | #include "globals.h" 30 | #ifdef USE_NET 31 | #include "SDL_net.h" 32 | #endif /* USE_NET */ 33 | 34 | /* networking shite. */ 35 | 36 | #define NETPKTBUFSIZE (4 + 4 + 4 + 4 + 4) 37 | 38 | #define NETCMD_NACK (0xF00DF00D + 0) 39 | #define NETCMD_ACK (0xF00DF00D + 1) 40 | #define NETCMD_HELLO (0xF00DF00D + 2) 41 | #define NETCMD_GREENLIGHT (0xF00DF00D + 3) 42 | #define NETCMD_MOVE (0xF00DF00D + 4) 43 | #define NETCMD_BYE (0xF00DF00D + 5) 44 | #define NETCMD_POSITION (0xF00DF00D + 6) 45 | #define NETCMD_ALIVE (0xF00DF00D + 7) 46 | #define NETCMD_KILL (0xF00DF00D + 8) 47 | 48 | extern int is_server; 49 | extern int is_net; 50 | extern int server_said_bye; 51 | 52 | typedef struct 53 | { 54 | Uint32 cmd; 55 | Sint32 arg; 56 | Sint32 arg2; 57 | Sint32 arg3; 58 | Sint32 arg4; 59 | } NetPacket; 60 | 61 | void processMovePacket(NetPacket *pkt); 62 | 63 | void tellServerPlayerMoved(int playerid, int movement_type, int newval); 64 | 65 | #ifdef USE_NET 66 | 67 | extern TCPsocket sock; 68 | extern SDLNet_SocketSet socketset; 69 | 70 | typedef struct 71 | { 72 | TCPsocket sock; 73 | IPaddress addr; 74 | SDLNet_SocketSet socketset; 75 | } NetInfo; 76 | 77 | extern NetInfo net_info[JNB_MAX_PLAYERS]; 78 | 79 | void bufToPacket(const char *buf, NetPacket *pkt); 80 | 81 | void packetToBuf(const NetPacket *pkt, char *buf); 82 | 83 | void sendPacketToSock(TCPsocket s, NetPacket *pkt); 84 | 85 | void sendPacket(int playerid, NetPacket *pkt); 86 | 87 | void sendPacketToAll(NetPacket *pkt); 88 | 89 | /** read a packet from the given TCPsocket 90 | Returns -1 if some error occured, 0 if there was no data available and 1 if a 91 | packet was successfully read. 92 | Note: the socket has to be in the supplied socketset. 93 | TODO: this function will bomb if a packet arrives in pieces, there is no 94 | inherent guarantee that the next call will be made on the same socket. */ 95 | int grabPacket(TCPsocket s, SDLNet_SocketSet ss, NetPacket *pkt); 96 | 97 | int serverRecvPacket(NetPacket *pkt); 98 | 99 | void wait_for_greenlight(void); 100 | 101 | void tellServerGoodbye(void); 102 | 103 | void tellServerNewPosition(void); 104 | 105 | #endif 106 | 107 | void processKillPacket(NetPacket *pkt); 108 | 109 | void processPositionPacket(NetPacket *pkt); 110 | 111 | void processAlivePacket(NetPacket *pkt); 112 | 113 | void serverTellEveryoneGoodbye(void); 114 | 115 | int update_players_from_server(void); 116 | 117 | void serverSendAlive(int playerid); 118 | 119 | void serverSendKillPacket(int killer, int victim); 120 | 121 | void update_players_from_clients(void); 122 | 123 | #if USE_NET 124 | 125 | void init_server(const char *netarg); 126 | 127 | void connect_to_server(char *netarg); 128 | 129 | #endif /* USE_NET */ 130 | 131 | #endif /* __NETWORK_H__ */ 132 | -------------------------------------------------------------------------------- /src/tools/jnbunpack.c: -------------------------------------------------------------------------------- 1 | /* 2 | * unpack.c 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 "timecop" 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #ifndef _WIN32 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | #define FILENAME_LENGTH 12 39 | 40 | typedef struct { 41 | char filename[FILENAME_LENGTH]; 42 | unsigned int offset; 43 | unsigned int size; 44 | } DirEntry; 45 | 46 | #ifndef O_BINARY 47 | #define O_BINARY 0 48 | #endif 49 | 50 | int main(int argc, char **argv) 51 | { 52 | int fd; 53 | DirEntry *datafile; 54 | int num_entries, i; 55 | 56 | if (argc < 2) { 57 | printf("dumbass, specify filename to unpack\n"); 58 | exit(1); 59 | } 60 | 61 | fd = open(argv[1], O_RDONLY | O_BINARY); 62 | if (fd == -1) { 63 | perror("open datafile"); 64 | exit(1); 65 | } 66 | /* get number of entries */ 67 | if (read(fd, &num_entries, 4) != 4) { 68 | perror("read num of entries"); 69 | exit(1); 70 | } 71 | 72 | printf("%d entries in datafile\n", num_entries); 73 | 74 | datafile = calloc(num_entries, sizeof(DirEntry)); 75 | if (!datafile) { 76 | perror("malloc failed"); 77 | exit(1); 78 | } 79 | 80 | if (read(fd, datafile, num_entries * sizeof(DirEntry)) != (ssize_t) (num_entries * sizeof(DirEntry))) { 81 | perror("read entries"); 82 | free(datafile); 83 | exit(1); 84 | } 85 | 86 | printf("Directory Listing:\n"); 87 | for (i = 0; i < num_entries; i++) { 88 | char filename[FILENAME_LENGTH + 1]; 89 | memset(filename, 0, sizeof(filename)); 90 | strncpy(filename, datafile[i].filename, FILENAME_LENGTH); 91 | printf("%02d:\t%s (%u bytes)\n", i, filename, 92 | datafile[i].size); 93 | } 94 | 95 | for (i = 0; i < num_entries; i++) { 96 | int outfd; 97 | char filename[2 + FILENAME_LENGTH + 1] = "./"; // dotslash + filename + null terminator 98 | char *buf; 99 | 100 | int j = 2; 101 | for (int k = 0; datafile[i].filename[k] != '\0' && k < FILENAME_LENGTH && j < 2 + FILENAME_LENGTH; k++) { 102 | if (datafile[i].filename[k] == '.' && datafile[i].filename[k + 1] == '.') { 103 | k++; // and one more ++ from for 104 | } else if (datafile[i].filename[k] != '/' && datafile[i].filename[k] != '\\') { 105 | filename[j] = datafile[i].filename[k]; 106 | j++; 107 | } 108 | } 109 | filename[j] = '\0'; 110 | 111 | printf("Extracting %s ", filename); 112 | fflush(stdout); 113 | 114 | if (remove(filename) == -1 && errno != ENOENT) { 115 | perror("cannot remove file"); 116 | exit(1); 117 | } 118 | outfd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0644); 119 | if (!outfd) { 120 | perror("cant open file"); 121 | exit(1); 122 | } 123 | lseek(fd, datafile[i].offset, SEEK_SET); 124 | buf = calloc(1, datafile[i].size + 16); 125 | if (!buf) { 126 | perror("malloc failed"); 127 | exit(1); 128 | } 129 | 130 | if (read(fd, buf, datafile[i].size) != datafile[i].size) { 131 | perror("reading file"); 132 | free(buf); 133 | exit(1); 134 | } 135 | 136 | if (write(outfd, buf, datafile[i].size) != datafile[i].size) { 137 | perror("writing to file"); 138 | free(buf); 139 | exit(1); 140 | } 141 | 142 | close(outfd); 143 | free(buf); 144 | printf("OK\n"); 145 | } 146 | close(fd); 147 | return 0; 148 | } 149 | -------------------------------------------------------------------------------- /src/sdl/input.c: -------------------------------------------------------------------------------- 1 | /* 2 | * input.c 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #include "globals.h" 27 | 28 | static int num_joys = 0; 29 | static SDL_Joystick *joys[4]; 30 | 31 | /* assumes joysticks have at least one button, could check numbuttons first? */ 32 | #define JOY_LEFT(num) (num_joys > num && SDL_JoystickGetAxis(joys[num], 0) < -3200) 33 | #define JOY_RIGHT(num) (num_joys > num && SDL_JoystickGetAxis(joys[num], 0) > 3200) 34 | /* I find using the vertical axis to be annoying -- dnb */ 35 | #define JOY_JUMP(num) (num_joys > num && SDL_JoystickGetButton(joys[num], 0)) 36 | 37 | int calib_joy(int type) 38 | { 39 | (void) type; 40 | return 1; 41 | } 42 | 43 | void update_player_actions(void) 44 | { 45 | int tmp; 46 | 47 | if (client_player_num < 0) { 48 | tmp = (key_pressed(KEY_PL1_LEFT) == 1) || JOY_LEFT(3); 49 | if (tmp != player[0].action_left) 50 | tellServerPlayerMoved(0, MOVEMENT_LEFT, tmp); 51 | tmp = (key_pressed(KEY_PL1_RIGHT) == 1) || JOY_RIGHT(3); 52 | if (tmp != player[0].action_right) 53 | tellServerPlayerMoved(0, MOVEMENT_RIGHT, tmp); 54 | tmp = (key_pressed(KEY_PL1_JUMP) == 1) || JOY_JUMP(3); 55 | if (tmp != player[0].action_up) 56 | tellServerPlayerMoved(0, MOVEMENT_UP, tmp); 57 | 58 | tmp = (key_pressed(KEY_PL2_LEFT) == 1) || JOY_LEFT(2); 59 | if (tmp != player[1].action_left) 60 | tellServerPlayerMoved(1, MOVEMENT_LEFT, tmp); 61 | tmp = (key_pressed(KEY_PL2_RIGHT) == 1) || JOY_RIGHT(2); 62 | if (tmp != player[1].action_right) 63 | tellServerPlayerMoved(1, MOVEMENT_RIGHT, tmp); 64 | tmp = (key_pressed(KEY_PL2_JUMP) == 1) || JOY_JUMP(2); 65 | if (tmp != player[1].action_up) 66 | tellServerPlayerMoved(1, MOVEMENT_UP, tmp); 67 | 68 | tmp = (key_pressed(KEY_PL3_LEFT) == 1) || JOY_LEFT(1); 69 | if (tmp != player[2].action_left) 70 | tellServerPlayerMoved(2, MOVEMENT_LEFT, tmp); 71 | tmp = (key_pressed(KEY_PL3_RIGHT) == 1) || JOY_RIGHT(1); 72 | if (tmp != player[2].action_right) 73 | tellServerPlayerMoved(2, MOVEMENT_RIGHT, tmp); 74 | tmp = (key_pressed(KEY_PL3_JUMP) == 1) || JOY_JUMP(1); 75 | if (tmp != player[2].action_up) 76 | tellServerPlayerMoved(2, MOVEMENT_UP, tmp); 77 | 78 | tmp = (key_pressed(KEY_PL4_LEFT) == 1) || JOY_LEFT(0); 79 | if (tmp != player[3].action_left) 80 | tellServerPlayerMoved(3, MOVEMENT_LEFT, tmp); 81 | tmp = (key_pressed(KEY_PL4_RIGHT) == 1) || JOY_RIGHT(0); 82 | if (tmp != player[3].action_right) 83 | tellServerPlayerMoved(3, MOVEMENT_RIGHT, tmp); 84 | tmp = (key_pressed(KEY_PL4_JUMP) == 1) || JOY_JUMP(0); 85 | if (tmp != player[3].action_up) 86 | tellServerPlayerMoved(3, MOVEMENT_UP, tmp); 87 | } else { 88 | tmp = (key_pressed(KEY_PL1_LEFT) == 1) || JOY_LEFT(0); 89 | if (tmp != player[client_player_num].action_left) 90 | tellServerPlayerMoved(client_player_num, MOVEMENT_LEFT, tmp); 91 | tmp = (key_pressed(KEY_PL1_RIGHT) == 1) || JOY_RIGHT(0); 92 | if (tmp != player[client_player_num].action_right) 93 | tellServerPlayerMoved(client_player_num, MOVEMENT_RIGHT, tmp); 94 | tmp = (key_pressed(KEY_PL1_JUMP) == 1) || JOY_JUMP(0); 95 | if (tmp != player[client_player_num].action_up) 96 | tellServerPlayerMoved(client_player_num, MOVEMENT_UP, tmp); 97 | } 98 | } 99 | 100 | void init_inputs(void) 101 | { 102 | int i; 103 | 104 | num_joys = SDL_NumJoysticks(); 105 | for (i = 0; i < 4 && i < num_joys; ++i) 106 | joys[i] = SDL_JoystickOpen(i); 107 | 108 | main_info.mouse_enabled = 0; 109 | main_info.joy_enabled = 0; 110 | } 111 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | (unreleased) - 1.70 2 | - Ported jumpnbump-menu to Python 3 and GTK+3 3 | - jumpnbump-menu is no longer installed by default, use `make install -C menu` 4 | to install it 5 | - Fixed using jetpack and other cheats (regression from SDL2 port) 6 | - Updated in-game credits 7 | - Move appdata file to metainfo directory (Linux) 8 | - Applied `clang-format` to code base 9 | - Packaging fixes and cleanups 10 | - Fixed memory leak in gobpack 11 | - Allowed jnbpack to take the full path 12 | - Added an output option for gobpack 13 | - Moved the build system to CMake 14 | 15 | 24 May 2017 - 1.60 16 | - Ported to SDL2 17 | - Window can now be resized 18 | - Show scores only for enabled players 19 | - Add Python/GTK+ jumpnbump-menu by Martin Willemoes Hansen 20 | - (Re-)Add Windows support via MinGW-w64 21 | - Handle temporary files in a safe way 22 | - Removed obsolete Tcl jnbmenu 23 | - Removed fireworks mode 24 | - Removed obsolete Kaillera network code 25 | - Fix warnings and merge some downstream patches (esp. from Debian) 26 | - Add desktop file, icon and appdata file (Linux) 27 | - Packaging fixes and cleanups 28 | 29 | 27 Jun 2004 - 1.51 30 | - refactored code to make it a bit simpler 31 | - Added AI by Ricardo Cruz 32 | 33 | 30 Mar 2004 - 1.42 34 | - added support for gzip and bzip2 packed levels. 35 | 36 | 21 Mar 2003 - 1.41 37 | - new scaling filter which works with 8bit graphics. Removed the old scaler 38 | completely, now fading and everything else works in scaled up mode. 39 | - another attempt to fix sound on big endian systems. 40 | 41 | 23 Sep 2002 - 1.40 42 | - manpage update 43 | - joystick support added 44 | - freebsd ports (thanks rigel from #demoscene) 45 | - a while back network code using kaillera was send to me by Gil Megidish, 46 | it's not enabled, because it doesn't seem to work good enough. 47 | 48 | 17 Aug 2002 - 1.39 49 | - added -noflies option 50 | - added client/server networking. Thanks to Ryan C. Gordon who did the base 51 | work for it. 52 | 53 | 11 Aug 2002 - 1.35 54 | - gobpack added 55 | - documentation updated 56 | - little fixes here and there 57 | 58 | 2 Aug 2002 - 1.34 59 | - fixed too dark font 60 | - attempt to fix sound and scaleup on big endian systems 61 | 62 | 5 Jul 2002 - 1.33 63 | - added -musicnosound option 64 | 65 | 15 Jun 2002 - 1.32 66 | - fix for off by one in -mirror 67 | - add icon for application (macosx,windows,x) 68 | 69 | 10 Jun 2002 - 1.31 70 | - rename jbmenu.tcl to jnbmenu.tcl, make it +x, add 71 | options for -mirror and -scaleup 72 | - update manpage and -h with -scaleup 73 | - update makefiles accordingly 74 | - rename pack/unpack to jnbpack/jnbunpack 75 | - set gametitle 76 | 77 | 9 Jun 2002 - 1.3 78 | - Added -mirror commandline option to play the level mirrored 79 | - Deleting temporary music file 80 | 81 | 17 Apr 2002 - 1.2 82 | - MacOS X fixes 83 | - some endian fixes 84 | 85 | 24 Feb 2002 - 1.1 86 | - fixed timing problems 87 | - fixed crash when temporary music can't be written 88 | 89 | 22 Feb 2002 - 1.0 90 | - working sound 91 | - new scaling graphics mode 92 | - cleaned up code 93 | 94 | =========================================================================== 95 | This is the changelog of the linux version from which this port is derived. 96 | 97 | 25 Feb 2001 - 0.69 98 | initial linux port, worked fine with freebsd too (chuck mason) 99 | 100 | 26 Feb 2001 - 0.69 101 | made sound be played (chuck mason) 102 | 103 | 03 Mar 2001 - 0.70 104 | fixing fps (longislandman) 105 | changing player input: 4 player at one keyboard (tarzeau) 106 | pack/unpack which packs/unpacks the leveldata (timecop) 107 | 108 | ?? Mar 2001 - 0.70 109 | network code has been written (longislandman, jonatkins.org) 110 | it werks but we won't release it until it's good for the masses, 111 | for test and fun play come join #keen on irc.linux.com 112 | (be sure to have one udp port open if you have a firewall, 113 | and also have sdl-mixer, sdl and sdl-net) 114 | 115 | 16 Mar 2001 - 0.70 116 | did a new screenshot http://jumpbump.mine.nu/port/jumpbumprocks.jpg 117 | wrote a little faq http://jumpbump.mine.nu/port/jumpbumpfaq.txt 118 | put online level-selector-menu http://jumpbump.mine.nu/port/jbmenu.tcl 119 | (received from philippe brochard, thank you!) 120 | 121 | 20 Mar 2001 - 0.72 122 | repackaged tarballs with network code jnb-net.tar.gz, 123 | menusystem and unpack/pack 124 | -------------------------------------------------------------------------------- /dist/jumpnbump.6: -------------------------------------------------------------------------------- 1 | .TH "Jump 'n Bump" 6 "August 25th, 2002" 2 | .SH NAME 3 | jumpnbump \- Cute multiplayer platform game with bunnies 4 | .SH SYNOPSIS 5 | jumpnbump \fR[\fB-dat \fIlevelname\fR] [\fB-server \fIclients_number\fR] [\fB-connect \fIhostname\fR] [\fB-fullscreen\fR] [\fB-nosound\fR] [\fB-musicnosound\fR] [\fB-nogore\fR] [\fB-noflies\fR] [\fB-mirror\fR] [\fB-scaleup\fR] [\fB-v\fR] [\fB-h\fR] 6 | .SH DESCRIPTION 7 | You, as a bunny, have to jump on your opponents to make them 8 | explode. It's a true multiplayer game, you can't play this alone. 9 | It has network support. 10 | .SH OPTIONS 11 | .IP "-dat \fIlevelname\fR" 12 | Load \fIlevelname\fR and use it as the level for this game. 13 | .IP "-server \fIclients_number\fR" 14 | Start as a server waiting on port TCP 11111 and wait for \fIclient_numbers\fR 15 | clients to connect before starting the game. 16 | .IP "-connect \fIhostname" 17 | Connect (using IP network) to remote server \fIhostname\fR. 18 | .IP "-fullscreen" 19 | Run Jump 'n Bump in fullscreen mode. 20 | .IP "-nosound" 21 | Run Jump 'n Bump without sound. 22 | .IP "-musicnosound" 23 | Run Jump 'n Bump with music but no sound effects. 24 | .IP "-nogore" 25 | Play without blood, familymode. 26 | .IP "-noflies" 27 | Disable flies. 28 | .IP "-mirror" 29 | Play with mirrored level. 30 | .IP "-scaleup" 31 | Play with doublesize resolution (800x512). 32 | .IP "-h" 33 | Print help. 34 | .IP "-v" 35 | Print version, compile time and if network code is compiled in. 36 | .SH USAGE 37 | The goal of the game is to jump on the other players. Each rabbit has 38 | three control keys. 39 | .IP "Player 1 (Dott)" 40 | Left - Left 41 | .br 42 | Right - Right 43 | .br 44 | Jump - Up 45 | .IP "Player 2 (Jiffy)" 46 | Left - A 47 | .br 48 | Right - D 49 | .br 50 | Jump - W 51 | .IP "Player 3 (Fizz)" 52 | Left - J 53 | .br 54 | Right - L 55 | .br 56 | Jump - I 57 | .IP "Player 4 (Mijji)" 58 | Left - 4 59 | .br 60 | Right - 5 61 | .br 62 | Jump - 8 63 | .IP "In the game" 64 | Turn on/off computer play (AI) of bunny 1 - 1 65 | .br 66 | Turn on/off computer play (AI) of bunny 2 - 2 67 | .br 68 | Turn on/off computer play (AI) of bunny 3 - 3 69 | .br 70 | Turn on/off computer play (AI) of bunny 4 - 4 71 | .br 72 | .SH SECRET CODES 73 | You can type these while in the game 74 | .br 75 | jetpack - you can fly 76 | .br 77 | pogostick - the bunnies keep jumping 78 | .br 79 | bunniesinspace - gravity is lower, you can jump higher 80 | .br 81 | lordoftheflies - the flies are attracted 82 | .br 83 | bloodisthickerthanwater - water turns to blood 84 | .SH LEVELS 85 | There are two programs to help you make your own levels: jnbpack and jnbunpack. 86 | .PP 87 | jnbpack -o /tmp/newlevel.dat etc 88 | .PP 89 | or you can just put all the files in a dir, cd to that dir and do 90 | .PP 91 | jnbpack -o /tmp/newlevel.dat * 92 | .PP 93 | and it will put all the files in the current dir inside the packfile. 94 | Don't try things like jnbpack -o stuff.dat ../file.c because it will add 95 | "../file.c" as the filename in the packfile, which won't work. 96 | .PP 97 | jnbunpack level.dat 98 | .br 99 | will unpack it in the current directory. 100 | .PP 101 | With gobpack you can convert .gob files (which are sprites, described in 102 | gob.txt) into .pcx files which you can edit with gimp for example, then 103 | convert back to a .gob and use it in your own level. 104 | .PP 105 | gobpack -u font menu.pcx 106 | .PP 107 | will unpack font.gob using the color palette from menu.pcx and write the 108 | files font.pcx font.txt. The other gob files should use level.pcx for the 109 | correct palette. 110 | .PP 111 | gobpack font 112 | .PP 113 | will generate font.gob from font.pcx and the specifications in font.txt. 114 | The .pcx files should be resaved with another program, as they are not 115 | packed and are thus very large. 116 | .SH AUTHORS 117 | .PP 118 | Chuck Mason , Jon Atkins , 119 | Philippe Brochard , Gürkan Sengün , 120 | Florian Schulze , Ricardo Cruz and "timecop" are 121 | the authors of Jump 'n Bump. 122 | .PP 123 | This program is a UNIX port of the old DOS game by brainchilddesign. 124 | .PP 125 | This manual page was written for the Debian GNU/Linux distribution because 126 | the original program does not have a manual page. 127 | .PP 128 | This manual page was written by Joe Wreschnig , for the 129 | Debian GNU/Linux system (but may be used by others). The manual page is kept 130 | up to date by Gürkan Sengün . 131 | -------------------------------------------------------------------------------- /src/include/dj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dj.h 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2002 Florian Schulze - crow@icculus.org 6 | * 7 | * This file is part of Jump 'n Bump. 8 | * 9 | * Jump 'n Bump is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * Jump 'n Bump is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | #ifdef DOS 28 | #include 29 | #include 30 | #include 31 | #include 32 | #endif 33 | 34 | #define DJ_SD_TYPE_NOSOUND 0 35 | #define DJ_SD_TYPE_SBLASTER 1 36 | 37 | #define DJ_SFX_TYPE_SSS 0 38 | #define DJ_SFX_TYPE_WAV 1 39 | #define DJ_SFX_TYPE_SMP 2 40 | 41 | typedef struct dj_hardware_info { 42 | char sd_type; 43 | short sd_version; 44 | short port; 45 | char irq; 46 | char dma; 47 | } dj_hardware_info; 48 | 49 | typedef struct dj_mixing_info { 50 | char sfx_volume, num_sfx_channels; 51 | char mod_volume, num_mod_channels; 52 | char stereo_mix, auto_mix; 53 | unsigned short mixing_freq; 54 | unsigned short dma_time, dmabuf_len; 55 | char cur_dmabuf; 56 | unsigned long dmabuf_address[2]; 57 | char *mixed_buf; 58 | } dj_mixing_info; 59 | 60 | typedef struct sfx_data { 61 | char priority; 62 | unsigned short default_freq; 63 | char default_volume; 64 | unsigned long length; 65 | char loop; 66 | unsigned long loop_start, loop_length; 67 | unsigned char *buf; 68 | } sfx_data; 69 | 70 | typedef struct dj_mod_info { 71 | char num_channels; 72 | char speed; 73 | short bpm; 74 | char order_pos; 75 | char pat_pos; 76 | char name[20]; 77 | struct { 78 | char name[22]; 79 | unsigned short length; 80 | char finetune; 81 | char volume; 82 | unsigned short loop_start; 83 | unsigned short loop_length; 84 | char *buf; 85 | } samples[31]; 86 | char song_length; 87 | char num_pat; 88 | char pat_order[128]; 89 | char *pat[128]; 90 | } dj_mod_info; 91 | 92 | extern char dj_init(void); 93 | extern void dj_deinit(void); 94 | extern void dj_start(void); 95 | extern void dj_stop(void); 96 | extern void dj_set_nosound(char flag); 97 | extern char dj_set_sd(char sd_type, short port, char irq, char dma); 98 | extern char dj_autodetect_sd(void); 99 | extern void dj_get_sd_string(char *strbuf); 100 | extern char dj_set_stereo(char flag); 101 | extern void dj_reverse_stereo(char flag); 102 | extern void dj_set_auto_mix(char flag); 103 | extern unsigned short dj_set_mixing_freq(unsigned short freq); 104 | extern void dj_set_dma_time(unsigned short time); 105 | extern char dj_get_hardware_info(dj_hardware_info *ptr); 106 | extern char dj_get_mixing_info(dj_mixing_info *ptr); 107 | extern char dj_get_mod_info(char mod_num, dj_mod_info *ptr); 108 | extern void dj_set_fake_vu_speed(unsigned char speed); 109 | extern unsigned char dj_get_fake_vu(char channel); 110 | extern char dj_reset_sd(void); 111 | 112 | extern char dj_mix_needed(void); 113 | extern void dj_mix(void); 114 | 115 | extern char dj_set_num_sfx_channels(char num_channels); 116 | extern void dj_set_sfx_volume(char volume); 117 | extern char dj_get_sfx_volume(void); 118 | extern void dj_play_sfx(unsigned char sfx_num, unsigned short freq, char volume, char panning, unsigned short delay, signed char channel); 119 | extern char dj_get_sfx_settings(unsigned char sfx_num, sfx_data *data); 120 | extern char dj_set_sfx_settings(unsigned char sfx_num, sfx_data *data); 121 | extern void dj_set_sfx_channel_volume(char channel_num, char volume); 122 | extern void dj_stop_sfx_channel(char channel_num); 123 | extern char dj_load_sfx(unsigned char *file_handle, char *filename, int file_length, char sfx_type, unsigned char sfx_num); 124 | extern void dj_free_sfx(unsigned char sfx_num); 125 | 126 | extern char dj_ready_mod(char mod_num); 127 | extern char dj_start_mod(void); 128 | extern void dj_stop_mod(void); 129 | extern void dj_set_mod_volume(char volume); 130 | extern char dj_get_mod_volume(void); 131 | extern char dj_load_mod(unsigned char *file_handle, char *filename, char mod_num); 132 | extern void dj_free_mod(char mod_num); 133 | -------------------------------------------------------------------------------- /src/sdl/jumpnbump64.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * jumpnbump_xpm[] = { 3 | "64 64 65 1", 4 | " c None", 5 | ". c #171010", 6 | "+ c #B2B2B2", 7 | "@ c #E61E1A", 8 | "# c #6E6C6B", 9 | "$ c #C20606", 10 | "% c #D0C6C4", 11 | "& c #FA7A12", 12 | "* c #411A05", 13 | "= c #D06D19", 14 | "- c #DA8636", 15 | "; c #5B5B5B", 16 | "> c #979696", 17 | ", c #F18A2D", 18 | "' c #D9D6D4", 19 | ") c #7D0A5E", 20 | "! c #BD752F", 21 | "~ c #E8DED9", 22 | "{ c #BABABA", 23 | "] c #8B8A88", 24 | "^ c #F28E39", 25 | "/ c #724E32", 26 | "( c #5A2A02", 27 | "_ c #CA6410", 28 | ": c #E7E3DF", 29 | "< c #FEB256", 30 | "[ c #AB5309", 31 | "} c #D69256", 32 | "| c #EEEAEA", 33 | "1 c #563216", 34 | "2 c #828282", 35 | "3 c #C26210", 36 | "4 c #6A3202", 37 | "5 c #875F3D", 38 | "6 c #D5B5A0", 39 | "7 c #832907", 40 | "8 c #D9711E", 41 | "9 c #EF9E49", 42 | "0 c #F2F2F2", 43 | "a c #302C2F", 44 | "b c #7A7A7A", 45 | "c c #C6AA92", 46 | "d c #434043", 47 | "e c #FECA96", 48 | "f c #BA5A0A", 49 | "g c #A64911", 50 | "h c #FB8321", 51 | "i c #E5A673", 52 | "j c #AD621E", 53 | "k c #505150", 54 | "l c #7E6552", 55 | "m c #A9A6A3", 56 | "n c #F5B683", 57 | "o c #843F05", 58 | "p c #FAA23A", 59 | "q c #9E5A26", 60 | "r c #FAD6BA", 61 | "s c #92765A", 62 | "t c #974C0A", 63 | "u c #FCFCFD", 64 | "v c #F07616", 65 | "w c #FEA847", 66 | "x c #727272", 67 | "y c #F5993F", 68 | "z c #222026", 69 | " ", 70 | " ", 71 | " ", 72 | " ", 73 | " ", 74 | " >>> ", 75 | " >>2b ", 76 | " #x ]2b#x ", 77 | " k;k 2]2x# ", 78 | " 2+m ;dd ]>b#b ", 79 | " ]mm>> ;ka >>#;> ", 80 | " %>++0 ]] kkkd 22xx ", 81 | " :+>m|> mx] ;k;a 2xx2 ", 82 | " 0:bb': m2#> k;;d ]2b2> ", 83 | " |u+m+u {m2b+ ;;#k 222>> ", 84 | " %0''m0 n6++m> ;;#b> b]>>> ", 85 | " m000%~mpyi6%%%+ ;k#2]]x]>> ", 86 | " >:uu:%cww6%':'% d#bxb]]>] ", 87 | " www!'u000|>>]k.4-h ", 90 | " j-wwww>2b]2dj&h&&, ", 91 | " q-w>#z;>]dv,,hhhhhhh ", 92 | " t9<<]dd]c;8hhh,h,h^hh ", 93 | " o-<>;ax>#8&,,hhhh^h, ", 94 | " 4!ww>#dx>x8h,,&hh,^h ", 95 | " t-ww6:u0u0uuuuuuuuu09j*..d;#b22>bkb>b8^hh,^,hhy ", 96 | " t8,c'0b+{u0{:uuuuuuej..zdk;#xx22xb]jooot=&yy ", 97 | " f8&v=v&-cmz%:u'k:uuuuuur=*.zdd;;###xsxf@41((4_^^ ", 98 | " t[vvv&&&&&v-#.|0u'k0uuuuu0r=*.aaakk;;##x5g$4otf=^yp ", 99 | " [&&&&&&&&&f5~|0'buuuuuu0%=4*..zdkkk;kdk)7t8hpypppp ", 100 | " 3&&&&&&&&&v&&nr+uuuuuu|}=o***.zaaadd/q3vpwwpppwwy ", 101 | " t=&&&&&&&&&&v^ru0uu|:'}_ft*.)..z1q8h^wwwpwwppppww ", 102 | " j8&&&&&&&&&&^n||0:'683g*)))(j8,^py 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #ifdef LINUX 34 | #include 35 | #endif 36 | #ifndef _WIN32 37 | #include 38 | #else 39 | #include 40 | #endif 41 | 42 | #define WRITE(f, b, s) \ 43 | { \ 44 | if (write(f, b, s) != s) { \ 45 | perror("Error while writing into file"); \ 46 | exit(1); \ 47 | } \ 48 | } 49 | 50 | typedef struct { 51 | char filename[12]; 52 | unsigned int offset; 53 | unsigned int size; 54 | } DirEntry; 55 | 56 | #ifndef O_BINARY 57 | #define O_BINARY 0 58 | #endif 59 | 60 | int main(int argc, char **argv) 61 | { 62 | int fd; 63 | DirEntry *datafile; 64 | int num_entries, i; 65 | int c; 66 | char *outfile = NULL; 67 | int offset = 0; 68 | 69 | #ifdef LINUX 70 | while ((c = getopt(argc, argv, "o:")) != EOF) { 71 | switch (c) { 72 | case 'o': 73 | if (optarg) { 74 | outfile = strdup(optarg); 75 | } 76 | break; 77 | } 78 | } 79 | argc -= optind; 80 | argv += optind; 81 | #else 82 | c = 1; 83 | while (c < argc) { 84 | if (argv[c][0] == '-') { 85 | if (argv[c][1] == 'o') { 86 | if (((c + 1) < argc) && (argv[c + 1])) { 87 | outfile = strdup(argv[c + 1]); 88 | c++; 89 | } 90 | c++; 91 | break; 92 | } 93 | } 94 | c++; 95 | } 96 | argc -= c; 97 | argv += c; 98 | #endif 99 | 100 | if (outfile == NULL) { 101 | printf("You must specify output filename with -o\n"); 102 | exit(1); 103 | } 104 | if (argc == 0) { 105 | printf("You must specify some files to pack, duh\n"); 106 | exit(1); 107 | } 108 | num_entries = argc; 109 | 110 | /* prepare to pack things - get sizes and calculate offsets */ 111 | printf("%i files to pack\n", num_entries); 112 | datafile = calloc(num_entries, sizeof(DirEntry)); 113 | 114 | /* skip past the directory structure */ 115 | offset = 4 + (num_entries * 20); 116 | 117 | for (i = 0; i < num_entries; i++) { 118 | struct stat dummy; 119 | if (stat(argv[i], &dummy)) { 120 | fprintf(stderr, "%s is not accessible: ", argv[i]); 121 | perror(""); 122 | exit(1); 123 | } 124 | 125 | char *filename = strdup(basename(argv[i])); 126 | if (strlen(filename) > 12) { 127 | fprintf(stderr, "filename %s is longer than 12 chars\n", argv[i]); 128 | free(filename); 129 | exit(1); 130 | } 131 | 132 | strncpy(datafile[i].filename, filename, 12); 133 | free(filename); 134 | datafile[i].size = dummy.st_size; 135 | /* num_entries * (12 + 8) */ 136 | datafile[i].offset = offset; 137 | offset += datafile[i].size; 138 | } 139 | 140 | /* here, we checked that all files are ok, and ready to roll the packfile */ 141 | fd = open(outfile, O_RDWR | O_CREAT | O_BINARY, 0644); 142 | if (fd == -1) { 143 | perror("opening packfile"); 144 | exit(1); 145 | } 146 | printf("Opened %s\n", outfile); 147 | 148 | /* write number of entries in this data file */ 149 | { 150 | char temp; 151 | 152 | temp = (num_entries >> 0) & 0xff; 153 | WRITE(fd, &temp, 1); 154 | temp = (num_entries >> 8) & 0xff; 155 | WRITE(fd, &temp, 1); 156 | temp = (num_entries >> 16) & 0xff; 157 | WRITE(fd, &temp, 1); 158 | temp = (num_entries >> 24) & 0xff; 159 | WRITE(fd, &temp, 1); 160 | } 161 | 162 | /* write the directory structure */ 163 | for (i = 0; i < num_entries; i++) { 164 | char temp; 165 | 166 | WRITE(fd, datafile[i].filename, 12); 167 | temp = (datafile[i].offset >> 0) & 0xff; 168 | WRITE(fd, &temp, 1); 169 | temp = (datafile[i].offset >> 8) & 0xff; 170 | WRITE(fd, &temp, 1); 171 | temp = (datafile[i].offset >> 16) & 0xff; 172 | WRITE(fd, &temp, 1); 173 | temp = (datafile[i].offset >> 24) & 0xff; 174 | WRITE(fd, &temp, 1); 175 | temp = (datafile[i].size >> 0) & 0xff; 176 | WRITE(fd, &temp, 1); 177 | temp = (datafile[i].size >> 8) & 0xff; 178 | WRITE(fd, &temp, 1); 179 | temp = (datafile[i].size >> 16) & 0xff; 180 | WRITE(fd, &temp, 1); 181 | temp = (datafile[i].size >> 24) & 0xff; 182 | WRITE(fd, &temp, 1); 183 | } 184 | 185 | /* write in the actual files */ 186 | for (i = 0; i < num_entries; i++) { 187 | int infd; 188 | char *buf; 189 | 190 | printf("adding %s ", argv[i]); 191 | 192 | infd = open(argv[i], O_RDONLY | O_BINARY); // taking the original path 193 | if (infd == -1) { 194 | perror("opening file"); 195 | exit(1); 196 | } 197 | buf = malloc(datafile[i].size + 16); 198 | if (!buf) { 199 | perror("malloc failed"); 200 | exit(1); 201 | } 202 | if (read(infd, buf, datafile[i].size) != datafile[i].size) { 203 | perror("reading file"); 204 | exit(1); 205 | } 206 | close(infd); 207 | if (write(fd, buf, datafile[i].size) != datafile[i].size) { 208 | perror("writing to file"); 209 | exit(1); 210 | } 211 | free(buf); 212 | printf(" OK\n"); 213 | } 214 | close(fd); 215 | return 0; 216 | } 217 | -------------------------------------------------------------------------------- /src/sdl/interrpt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * interrpt.c 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * Copyright (C) 2015 Côme Chilliet 10 | * 11 | * This file is part of Jump 'n Bump. 12 | * 13 | * Jump 'n Bump is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Jump 'n Bump is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #ifndef _WIN32 32 | #include 33 | #endif 34 | #include "globals.h" 35 | 36 | char keyb[256]; 37 | char last_keys[50]; 38 | 39 | int addkey(unsigned int key) 40 | { 41 | if (!(key & 0x8000)) 42 | keyb[key & 0x7fff] = 1; 43 | else 44 | keyb[key & 0x7fff] = 0; 45 | return 0; 46 | } 47 | 48 | void add_last_key(unsigned int key) 49 | { 50 | int c1; 51 | 52 | for (c1 = 48; c1 > 0; c1--) 53 | last_keys[c1] = last_keys[c1 - 1]; 54 | last_keys[0] = key; 55 | } 56 | 57 | void remove_keyb_handler(void) 58 | { 59 | } 60 | 61 | int hook_keyb_handler(void) 62 | { 63 | memset((void *) last_keys, 0, sizeof(last_keys)); 64 | 65 | return 0; 66 | } 67 | 68 | int key_pressed(int key) 69 | { 70 | return keyb[(unsigned char) key]; 71 | } 72 | 73 | int intr_sysupdate() 74 | { 75 | SDL_Event e; 76 | int i = 0; 77 | static int last_time = 0; 78 | int now, time_diff; 79 | 80 | while (SDL_PollEvent(&e)) { 81 | switch (e.type) { 82 | case SDL_QUIT: 83 | printf("FIXME: exit gracefully\n"); 84 | SDL_Quit(); 85 | exit(1); 86 | break; 87 | case SDL_MOUSEBUTTONDOWN: 88 | case SDL_MOUSEBUTTONUP: 89 | if (e.button.state == SDL_PRESSED && 90 | ((key_pressed(KEY_PL3_LEFT) && e.button.button == SDL_BUTTON_RIGHT) || 91 | (key_pressed(KEY_PL3_RIGHT) && e.button.button == SDL_BUTTON_LEFT) || 92 | (e.button.button == SDL_BUTTON_LEFT && e.button.button == SDL_BUTTON_RIGHT) || 93 | e.button.button == SDL_BUTTON_MIDDLE)) { 94 | addkey(KEY_PL3_JUMP & 0x7fff); 95 | } else if (e.button.state == SDL_RELEASED && 96 | ((key_pressed(KEY_PL3_LEFT) && e.button.button == SDL_BUTTON_RIGHT) || 97 | (key_pressed(KEY_PL3_RIGHT) && e.button.button == SDL_BUTTON_LEFT) || 98 | e.button.button == SDL_BUTTON_MIDDLE)) { 99 | addkey((KEY_PL3_JUMP & 0x7fff) | 0x8000); 100 | } 101 | 102 | if (e.button.button == SDL_BUTTON_LEFT) { 103 | SDL_Scancode scancode = KEY_PL3_LEFT; 104 | scancode &= 0x7fff; 105 | if (e.button.state == SDL_RELEASED) { 106 | if (key_pressed(KEY_PL3_JUMP) && (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_RIGHT))) 107 | addkey(KEY_PL3_RIGHT & 0x7fff); 108 | else 109 | scancode |= 0x8000; 110 | } 111 | addkey(scancode); 112 | } else if (e.button.button == SDL_BUTTON_RIGHT) { 113 | SDL_Scancode scancode = KEY_PL3_RIGHT; 114 | scancode &= 0x7fff; 115 | if (e.button.state == SDL_RELEASED) { 116 | if (key_pressed(KEY_PL3_JUMP) && (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_LEFT))) 117 | addkey(KEY_PL3_LEFT & 0x7fff); 118 | else 119 | scancode |= 0x8000; 120 | } 121 | addkey(scancode); 122 | } 123 | break; 124 | case SDL_KEYDOWN: 125 | case SDL_KEYUP: 126 | if (e.key.repeat != 0) { 127 | continue; 128 | } 129 | switch (e.key.keysym.scancode) { 130 | case SDL_SCANCODE_F12: 131 | if (e.type == SDL_KEYDOWN) { 132 | SDL_Quit(); 133 | exit(1); 134 | } 135 | break; 136 | case SDL_SCANCODE_F10: 137 | if (e.type == SDL_KEYDOWN) { 138 | fs_toggle(); 139 | } 140 | break; 141 | case SDL_SCANCODE_1: 142 | if (e.type == SDL_KEYUP) 143 | ai[0] = !ai[0]; 144 | 145 | /* Release keys, otherwise it will continue moving that way */ 146 | addkey((KEY_PL1_LEFT & 0x7fff) | 0x8000); 147 | addkey((KEY_PL1_RIGHT & 0x7fff) | 0x8000); 148 | addkey((KEY_PL1_JUMP & 0x7fff) | 0x8000); 149 | break; 150 | case SDL_SCANCODE_2: 151 | if (e.type == SDL_KEYUP) 152 | ai[1] = !ai[1]; 153 | 154 | /* Release keys, otherwise it will continue moving that way */ 155 | addkey((KEY_PL2_LEFT & 0x7fff) | 0x8000); 156 | addkey((KEY_PL2_RIGHT & 0x7fff) | 0x8000); 157 | addkey((KEY_PL2_JUMP & 0x7fff) | 0x8000); 158 | break; 159 | case SDL_SCANCODE_3: 160 | if (e.type == SDL_KEYUP) 161 | ai[2] = !ai[2]; 162 | 163 | /* Release keys, otherwise it will continue moving that way */ 164 | addkey((KEY_PL3_LEFT & 0x7fff) | 0x8000); 165 | addkey((KEY_PL3_RIGHT & 0x7fff) | 0x8000); 166 | addkey((KEY_PL3_JUMP & 0x7fff) | 0x8000); 167 | break; 168 | case SDL_SCANCODE_4: 169 | if (e.type == SDL_KEYUP) 170 | ai[3] = !ai[3]; 171 | 172 | /* Release keys, otherwise it will continue moving that way */ 173 | addkey((KEY_PL4_LEFT & 0x7fff) | 0x8000); 174 | addkey((KEY_PL4_RIGHT & 0x7fff) | 0x8000); 175 | addkey((KEY_PL4_JUMP & 0x7fff) | 0x8000); 176 | break; 177 | case SDL_SCANCODE_ESCAPE: 178 | if (e.type == SDL_KEYUP) 179 | addkey(1 | 0x8000); 180 | else 181 | addkey(1 & 0x7fff); 182 | break; 183 | default: 184 | e.key.keysym.scancode &= 0x7fff; 185 | if (e.type == SDL_KEYUP) { 186 | e.key.keysym.scancode |= 0x8000; 187 | add_last_key(e.key.keysym.sym); 188 | } 189 | addkey(e.key.keysym.scancode); 190 | break; 191 | } 192 | break; 193 | default: 194 | break; 195 | } 196 | i++; 197 | } 198 | 199 | SDL_Delay(1); 200 | now = SDL_GetTicks(); 201 | time_diff = now - last_time; 202 | if (time_diff > 0) { 203 | i = time_diff / (1000 / 60); 204 | if (i) { 205 | last_time = now; 206 | } else { 207 | int tmp; 208 | 209 | tmp = (1000 / 60) - i - 10; 210 | if (tmp > 0) 211 | SDL_Delay(tmp); 212 | } 213 | } 214 | 215 | return i; 216 | } 217 | -------------------------------------------------------------------------------- /data/rabbit.txt: -------------------------------------------------------------------------------- 1 | num_images: 72 2 | 3 | image: 1 4 | x: 0 5 | y: 0 6 | width: 13 7 | height: 15 8 | hotspot_x: -2 9 | hotspot_y: -1 10 | 11 | image: 2 12 | x: 19 13 | y: 0 14 | width: 14 15 | height: 14 16 | hotspot_x: -2 17 | hotspot_y: 0 18 | 19 | image: 3 20 | x: 38 21 | y: 0 22 | width: 14 23 | height: 16 24 | hotspot_x: -2 25 | hotspot_y: 2 26 | 27 | image: 4 28 | x: 57 29 | y: 0 30 | width: 13 31 | height: 16 32 | hotspot_x: -3 33 | hotspot_y: 2 34 | 35 | image: 5 36 | x: 76 37 | y: 0 38 | width: 14 39 | height: 14 40 | hotspot_x: -3 41 | hotspot_y: -2 42 | 43 | image: 6 44 | x: 95 45 | y: 0 46 | width: 15 47 | height: 14 48 | hotspot_x: -1 49 | hotspot_y: 0 50 | 51 | image: 7 52 | x: 114 53 | y: 0 54 | width: 16 55 | height: 16 56 | hotspot_x: 0 57 | hotspot_y: 0 58 | 59 | image: 8 60 | x: 133 61 | y: 0 62 | width: 17 63 | height: 16 64 | hotspot_x: 1 65 | hotspot_y: 0 66 | 67 | image: 9 68 | x: 152 69 | y: 0 70 | width: 17 71 | height: 13 72 | hotspot_x: -1 73 | hotspot_y: -3 74 | 75 | image: 10 76 | x: 171 77 | y: 0 78 | width: 13 79 | height: 15 80 | hotspot_x: -1 81 | hotspot_y: -1 82 | 83 | image: 11 84 | x: 190 85 | y: 0 86 | width: 14 87 | height: 14 88 | hotspot_x: 0 89 | hotspot_y: 0 90 | 91 | image: 12 92 | x: 209 93 | y: 0 94 | width: 14 95 | height: 16 96 | hotspot_x: 0 97 | hotspot_y: 2 98 | 99 | image: 13 100 | x: 228 101 | y: 0 102 | width: 13 103 | height: 16 104 | hotspot_x: 0 105 | hotspot_y: 2 106 | 107 | image: 14 108 | x: 247 109 | y: 0 110 | width: 14 111 | height: 14 112 | hotspot_x: 1 113 | hotspot_y: -1 114 | 115 | image: 15 116 | x: 266 117 | y: 0 118 | width: 15 119 | height: 14 120 | hotspot_x: 0 121 | hotspot_y: 1 122 | 123 | image: 16 124 | x: 285 125 | y: 0 126 | width: 16 127 | height: 16 128 | hotspot_x: 0 129 | hotspot_y: 2 130 | 131 | image: 17 132 | x: 304 133 | y: 0 134 | width: 17 135 | height: 16 136 | hotspot_x: 0 137 | hotspot_y: 2 138 | 139 | image: 18 140 | x: 323 141 | y: 0 142 | width: 17 143 | height: 13 144 | hotspot_x: 2 145 | hotspot_y: -4 146 | 147 | image: 19 148 | x: 342 149 | y: 0 150 | width: 13 151 | height: 15 152 | hotspot_x: -2 153 | hotspot_y: -1 154 | 155 | image: 20 156 | x: 361 157 | y: 0 158 | width: 14 159 | height: 14 160 | hotspot_x: -2 161 | hotspot_y: 0 162 | 163 | image: 21 164 | x: 380 165 | y: 0 166 | width: 14 167 | height: 16 168 | hotspot_x: -2 169 | hotspot_y: 2 170 | 171 | image: 22 172 | x: 0 173 | y: 18 174 | width: 13 175 | height: 16 176 | hotspot_x: -3 177 | hotspot_y: 2 178 | 179 | image: 23 180 | x: 19 181 | y: 18 182 | width: 14 183 | height: 14 184 | hotspot_x: -3 185 | hotspot_y: -2 186 | 187 | image: 24 188 | x: 38 189 | y: 18 190 | width: 15 191 | height: 14 192 | hotspot_x: -1 193 | hotspot_y: 0 194 | 195 | image: 25 196 | x: 57 197 | y: 18 198 | width: 16 199 | height: 16 200 | hotspot_x: 0 201 | hotspot_y: 0 202 | 203 | image: 26 204 | x: 76 205 | y: 18 206 | width: 17 207 | height: 16 208 | hotspot_x: 1 209 | hotspot_y: 0 210 | 211 | image: 27 212 | x: 95 213 | y: 18 214 | width: 17 215 | height: 13 216 | hotspot_x: -1 217 | hotspot_y: -3 218 | 219 | image: 28 220 | x: 114 221 | y: 18 222 | width: 13 223 | height: 15 224 | hotspot_x: -1 225 | hotspot_y: -1 226 | 227 | image: 29 228 | x: 133 229 | y: 18 230 | width: 14 231 | height: 14 232 | hotspot_x: 0 233 | hotspot_y: 0 234 | 235 | image: 30 236 | x: 152 237 | y: 18 238 | width: 14 239 | height: 16 240 | hotspot_x: 0 241 | hotspot_y: 2 242 | 243 | image: 31 244 | x: 171 245 | y: 18 246 | width: 13 247 | height: 16 248 | hotspot_x: 0 249 | hotspot_y: 2 250 | 251 | image: 32 252 | x: 190 253 | y: 18 254 | width: 14 255 | height: 14 256 | hotspot_x: 1 257 | hotspot_y: -1 258 | 259 | image: 33 260 | x: 209 261 | y: 18 262 | width: 15 263 | height: 14 264 | hotspot_x: 0 265 | hotspot_y: 1 266 | 267 | image: 34 268 | x: 228 269 | y: 18 270 | width: 16 271 | height: 16 272 | hotspot_x: 0 273 | hotspot_y: 2 274 | 275 | image: 35 276 | x: 247 277 | y: 18 278 | width: 17 279 | height: 16 280 | hotspot_x: 0 281 | hotspot_y: 2 282 | 283 | image: 36 284 | x: 266 285 | y: 18 286 | width: 17 287 | height: 13 288 | hotspot_x: 2 289 | hotspot_y: -4 290 | 291 | image: 37 292 | x: 285 293 | y: 18 294 | width: 13 295 | height: 15 296 | hotspot_x: -2 297 | hotspot_y: -1 298 | 299 | image: 38 300 | x: 304 301 | y: 18 302 | width: 14 303 | height: 14 304 | hotspot_x: -2 305 | hotspot_y: 0 306 | 307 | image: 39 308 | x: 323 309 | y: 18 310 | width: 14 311 | height: 16 312 | hotspot_x: -2 313 | hotspot_y: 2 314 | 315 | image: 40 316 | x: 342 317 | y: 18 318 | width: 13 319 | height: 16 320 | hotspot_x: -3 321 | hotspot_y: 2 322 | 323 | image: 41 324 | x: 361 325 | y: 18 326 | width: 14 327 | height: 14 328 | hotspot_x: -3 329 | hotspot_y: -2 330 | 331 | image: 42 332 | x: 380 333 | y: 18 334 | width: 15 335 | height: 14 336 | hotspot_x: -1 337 | hotspot_y: 0 338 | 339 | image: 43 340 | x: 0 341 | y: 36 342 | width: 16 343 | height: 16 344 | hotspot_x: 0 345 | hotspot_y: 0 346 | 347 | image: 44 348 | x: 19 349 | y: 36 350 | width: 17 351 | height: 16 352 | hotspot_x: 1 353 | hotspot_y: 0 354 | 355 | image: 45 356 | x: 38 357 | y: 36 358 | width: 17 359 | height: 13 360 | hotspot_x: -1 361 | hotspot_y: -3 362 | 363 | image: 46 364 | x: 57 365 | y: 36 366 | width: 13 367 | height: 15 368 | hotspot_x: -1 369 | hotspot_y: -1 370 | 371 | image: 47 372 | x: 76 373 | y: 36 374 | width: 14 375 | height: 14 376 | hotspot_x: 0 377 | hotspot_y: 0 378 | 379 | image: 48 380 | x: 95 381 | y: 36 382 | width: 14 383 | height: 16 384 | hotspot_x: 0 385 | hotspot_y: 2 386 | 387 | image: 49 388 | x: 114 389 | y: 36 390 | width: 13 391 | height: 16 392 | hotspot_x: 0 393 | hotspot_y: 2 394 | 395 | image: 50 396 | x: 133 397 | y: 36 398 | width: 14 399 | height: 14 400 | hotspot_x: 1 401 | hotspot_y: -1 402 | 403 | image: 51 404 | x: 152 405 | y: 36 406 | width: 15 407 | height: 14 408 | hotspot_x: 0 409 | hotspot_y: 1 410 | 411 | image: 52 412 | x: 171 413 | y: 36 414 | width: 16 415 | height: 16 416 | hotspot_x: 0 417 | hotspot_y: 2 418 | 419 | image: 53 420 | x: 190 421 | y: 36 422 | width: 17 423 | height: 16 424 | hotspot_x: 0 425 | hotspot_y: 2 426 | 427 | image: 54 428 | x: 209 429 | y: 36 430 | width: 17 431 | height: 13 432 | hotspot_x: 2 433 | hotspot_y: -4 434 | 435 | image: 55 436 | x: 228 437 | y: 36 438 | width: 13 439 | height: 15 440 | hotspot_x: -2 441 | hotspot_y: -1 442 | 443 | image: 56 444 | x: 247 445 | y: 36 446 | width: 14 447 | height: 14 448 | hotspot_x: -2 449 | hotspot_y: -1 450 | 451 | image: 57 452 | x: 266 453 | y: 36 454 | width: 14 455 | height: 16 456 | hotspot_x: -2 457 | hotspot_y: 2 458 | 459 | image: 58 460 | x: 285 461 | y: 36 462 | width: 13 463 | height: 16 464 | hotspot_x: -3 465 | hotspot_y: 2 466 | 467 | image: 59 468 | x: 304 469 | y: 36 470 | width: 14 471 | height: 14 472 | hotspot_x: -3 473 | hotspot_y: -2 474 | 475 | image: 60 476 | x: 323 477 | y: 36 478 | width: 15 479 | height: 14 480 | hotspot_x: -1 481 | hotspot_y: 0 482 | 483 | image: 61 484 | x: 342 485 | y: 36 486 | width: 16 487 | height: 16 488 | hotspot_x: 0 489 | hotspot_y: 0 490 | 491 | image: 62 492 | x: 361 493 | y: 36 494 | width: 17 495 | height: 16 496 | hotspot_x: 1 497 | hotspot_y: 0 498 | 499 | image: 63 500 | x: 380 501 | y: 36 502 | width: 17 503 | height: 13 504 | hotspot_x: -1 505 | hotspot_y: -3 506 | 507 | image: 64 508 | x: 0 509 | y: 54 510 | width: 13 511 | height: 15 512 | hotspot_x: -1 513 | hotspot_y: -1 514 | 515 | image: 65 516 | x: 19 517 | y: 54 518 | width: 14 519 | height: 14 520 | hotspot_x: 0 521 | hotspot_y: 0 522 | 523 | image: 66 524 | x: 38 525 | y: 54 526 | width: 14 527 | height: 16 528 | hotspot_x: 0 529 | hotspot_y: 2 530 | 531 | image: 67 532 | x: 57 533 | y: 54 534 | width: 13 535 | height: 16 536 | hotspot_x: 0 537 | hotspot_y: 2 538 | 539 | image: 68 540 | x: 76 541 | y: 54 542 | width: 14 543 | height: 14 544 | hotspot_x: 1 545 | hotspot_y: -1 546 | 547 | image: 69 548 | x: 95 549 | y: 54 550 | width: 15 551 | height: 14 552 | hotspot_x: 0 553 | hotspot_y: 1 554 | 555 | image: 70 556 | x: 114 557 | y: 54 558 | width: 16 559 | height: 16 560 | hotspot_x: 0 561 | hotspot_y: 2 562 | 563 | image: 71 564 | x: 133 565 | y: 54 566 | width: 17 567 | height: 16 568 | hotspot_x: 0 569 | hotspot_y: 2 570 | 571 | image: 72 572 | x: 152 573 | y: 54 574 | width: 17 575 | height: 13 576 | hotspot_x: 2 577 | hotspot_y: -4 578 | 579 | -------------------------------------------------------------------------------- /src/menu/jumpnbump_menu.py.pre: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2002 Martin Willemoes Hansen 5 | # Copyright (C) 2019 Dawid Gan 6 | # 7 | # Jump 'n Bump is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # Jump 'n Bump is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, write to the Free Software 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 | 21 | import sys 22 | import os 23 | import tempfile 24 | import shutil 25 | import gettext 26 | 27 | import gi 28 | gi.require_version('Gtk', '3.0') 29 | from gi.repository import Gtk, Gdk, GObject 30 | 31 | from PIL import Image 32 | 33 | RESOURCE_DIR = '%%DATADIR%%/jumpnbump' 34 | BINARY_DIR = '%%BINDIR%%' 35 | UNPACK_BIN = '%%UNPACKBIN%%' 36 | 37 | application = "jumpnbump-menu" 38 | gettext.install(application) 39 | 40 | 41 | def populate_treeview(): 42 | levels = [] 43 | add_levels(levels, RESOURCE_DIR) 44 | add_levels(levels, os.path.expanduser("~/.jumpnbump/levels")) 45 | 46 | levels = sorted(levels, key=lambda level: level[0]) 47 | 48 | COLUMN_LEVEL = 0 49 | COLUMN_DIR = 1 50 | store = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING) 51 | 52 | for level in levels: 53 | iter = store.append() 54 | store.set(iter, COLUMN_LEVEL, level[0], COLUMN_DIR, level[1]) 55 | 56 | treeview.set_model(store) 57 | 58 | renderer = Gtk.CellRendererText() 59 | treeview.append_column(Gtk.TreeViewColumn( 60 | _('Level'), renderer, text=COLUMN_LEVEL)) 61 | 62 | 63 | def add_levels(levels, dir): 64 | try: 65 | for file in os.listdir(dir): 66 | if (file.endswith('.dat') or file.endswith('.DAT')): 67 | levels.append((file, dir)) 68 | except OSError as err: 69 | print("%s not found (%s)." % (dir, str(err))) 70 | 71 | 72 | def standalone_mode(widget): 73 | disable_enable_level(1) 74 | disable_enable_server(0) 75 | num_clients.set_sensitive(0) 76 | nogore.set_sensitive(1) 77 | noflies.set_sensitive(1) 78 | 79 | 80 | def client_mode(widget): 81 | disable_enable_level(1) 82 | disable_enable_server(1) 83 | num_clients.set_sensitive(0) 84 | nogore.set_sensitive(1) 85 | noflies.set_sensitive(1) 86 | 87 | 88 | def server_mode(widget): 89 | disable_enable_level(1) 90 | disable_enable_server(0) 91 | num_clients.set_sensitive(1) 92 | nogore.set_sensitive(1) 93 | noflies.set_sensitive(1) 94 | 95 | 96 | def disable_enable_server(setting): 97 | server_entry.set_sensitive(setting) 98 | player_num.set_sensitive(setting) 99 | 100 | 101 | def disable_enable_level(setting): 102 | treeview.set_sensitive(setting) 103 | mirror.set_sensitive(setting) 104 | if (not setting): 105 | mirror.set_active(setting) 106 | 107 | 108 | def level_changed(widget): 109 | model, iter = treeview.get_selection().get_selected() 110 | global choosen_level 111 | choosen_level = '%s/%s' % (model.get_value(iter, 1), 112 | model.get_value(iter, 0)) 113 | unpackdir = None 114 | try: 115 | unpackdir = tempfile.mkdtemp("", "jumpnbump-menu-") 116 | os.chdir(unpackdir) 117 | os.spawnlp(os.P_WAIT, UNPACK_BIN, 118 | 'unpack', choosen_level) 119 | im = Image.open('level.pcx') 120 | w, h = im.size 121 | im.thumbnail([w/2, h/2], Image.ANTIALIAS) 122 | im.save('level.png') 123 | im.close() 124 | image.set_from_file('level.png') 125 | except Exception as err: 126 | print(err) 127 | finally: 128 | if unpackdir != None: 129 | shutil.rmtree(unpackdir) 130 | 131 | image.show() 132 | 133 | 134 | def about(widget): 135 | global about_dialog 136 | if (not about_dialog.is_visible()): 137 | about_dialog.show_all() 138 | 139 | 140 | def about_close(widget): 141 | global about_dialog 142 | about_dialog.hide() 143 | 144 | def about_quit(widget, event): 145 | global about_dialog 146 | about_dialog.hide() 147 | return True 148 | 149 | 150 | def run(widget): 151 | if (standalone.get_active()): 152 | execute(*get_level() + common_options()) 153 | elif (client.get_active()): 154 | execute('-player', str(player_num.get_value_as_int()), 155 | '-connect', server_entry.get_text(), 156 | *get_level() + common_options()) 157 | else: 158 | execute('-server', str(num_clients.get_value_as_int()), 159 | *get_level() + common_options()) 160 | 161 | 162 | def get_level(): 163 | level = [] 164 | if (mirror.get_active()): 165 | level.append('-mirror') 166 | 167 | level.append('-dat') 168 | level.append(choosen_level) 169 | 170 | return level 171 | 172 | 173 | def common_options(): 174 | options = [] 175 | 176 | if (fullscreen.get_active()): 177 | options.append('-fullscreen') 178 | if (nogore.get_active()): 179 | options.append('-nogore') 180 | if (double_res.get_active()): 181 | options.append('-scaleup') 182 | if (nosound.get_active()): 183 | options.append('-nosound') 184 | if (noflies.get_active()): 185 | options.append('-noflies') 186 | if (withmusic.get_active()): 187 | options.append('-musicnosound') 188 | if (mirror.get_active()): 189 | options.append('-mirror') 190 | 191 | return options 192 | 193 | 194 | def execute(*cmd): 195 | try: 196 | os.spawnl(os.P_NOWAIT, BINARY_DIR + '/jumpnbump', 'jumpnbump', *cmd) 197 | except Exception as err: 198 | print(err) 199 | 200 | 201 | def main(): 202 | global gladefile 203 | 204 | global_gladefile = RESOURCE_DIR + '/jumpnbump_menu.glade' 205 | local_gladefile = './jumpnbump_menu.glade' 206 | 207 | if (os.access(global_gladefile, os.R_OK)): 208 | gladefile = global_gladefile 209 | del local_gladefile 210 | elif (os.access(local_gladefile, os.R_OK)): 211 | gladefile = local_gladefile 212 | del global_gladefile 213 | else: 214 | print('Could not find the glade file') 215 | return 0 216 | 217 | gui = Gtk.Builder() 218 | gui.add_from_file(gladefile) 219 | 220 | global about_dialog, choosen_level, standalone, client, server, treeview, \ 221 | mirror, num_clients, server_entry, player_num, fullscreen, \ 222 | nogore, double_res, nosound, noflies, withmusic, image 223 | 224 | choosen_level = '' 225 | standalone = gui.get_object('standalone') 226 | client = gui.get_object('client') 227 | server = gui.get_object('server') 228 | treeview = gui.get_object('level_treeview') 229 | populate_treeview() 230 | mirror = gui.get_object('mirror') 231 | num_clients = gui.get_object('num_of_clients') 232 | server_entry = gui.get_object('server_entry') 233 | player_num = gui.get_object('player_num') 234 | fullscreen = gui.get_object('fullscreen') 235 | nogore = gui.get_object('nogore') 236 | double_res = gui.get_object('double_res') 237 | nosound = gui.get_object('nosound') 238 | noflies = gui.get_object('noflies') 239 | withmusic = gui.get_object('withmusic') 240 | image = gui.get_object('image') 241 | about_dialog = gui.get_object('about') 242 | 243 | gui.connect_signals({'standalone_mode': standalone_mode, 244 | 'client_mode': client_mode, 245 | 'server_mode': server_mode, 246 | 'level_changed': level_changed, 247 | 'quit': lambda *args: Gtk.main_quit(), 248 | 'run': run, 249 | 'about': about, 250 | 'about_ok': about_close, 251 | 'about_quit': about_quit}) 252 | 253 | Gtk.main() 254 | 255 | if __name__ == '__main__': 256 | main() 257 | -------------------------------------------------------------------------------- /src/sdl/filter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * filter.c 3 | * Copyright (C) 2003 Florian Schulze 4 | * 5 | * This file is part of Jump 'n Bump. 6 | * 7 | * Jump 'n Bump is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Jump 'n Bump is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | /* 23 | The following scaling filter is called advancedmame2x. 24 | The implementation found here was possible because of the great ideas of 25 | Lucas Pope. 26 | */ 27 | 28 | typedef unsigned char byte; 29 | static int scale2x_inited = 0; 30 | static byte lookup_map[4 * 16]; 31 | 32 | void init_scale2x(void) 33 | { 34 | int i; 35 | 36 | if (scale2x_inited) 37 | return; 38 | 39 | //------------------------------------------------------------------------- 40 | // scale2x takes the following source: 41 | // A B C 42 | // D E F 43 | // G H I 44 | // 45 | // and doubles the size of E to produce: 46 | // E0 E1 47 | // E2 E3 48 | // 49 | // E0 = D == B && B != F && D != H ? D : E; 50 | // E1 = B == F && B != D && F != H ? F : E; 51 | // E2 = D == H && D != B && H != F ? D : E; 52 | // E3 = H == F && D != H && B != F ? F : E; 53 | // 54 | // to make this comparison regimen faster, we encode source color 55 | // equivalency into a single byte with the getCode() macro 56 | // 57 | // #define getCode(b,f,h,d) ( (b == f)<<0 | (f == h)<<1 | (h == d)<<2 | (d == b)<<3 ) 58 | 59 | // encode the scale2x conditionals into a lookup code 60 | for (i = 0; i < 16; i++) { 61 | // E0 = D == B && B != F && D != H ? D : E; // 10-0 => 1000 or 1010 => 8 or A 62 | lookup_map[0 * 16 + i] = (i == 0x8 || i == 0xA) ? 0 : 1; 63 | // E1 = B == F && B != D && F != H ? F : E; // 0-01 => 0101 or 0001 => 5 or 1 64 | lookup_map[1 * 16 + i] = (i == 0x5 || i == 0x1) ? 2 : 1; 65 | // E2 = D == H && D != B && H != F ? D : E; // 010- => 0101 or 0100 => 5 or 4 66 | lookup_map[2 * 16 + i] = (i == 0x4 || i == 0x5) ? 0 : 1; 67 | // E3 = H == F && D != H && B != F ? F : E; // -010 => 1010 or 0010 => A or 2 68 | lookup_map[3 * 16 + i] = (i == 0xA || i == 0x2) ? 2 : 1; 69 | } 70 | } 71 | 72 | void do_scale2x(unsigned char *src, 73 | int src_width, 74 | int src_height, 75 | unsigned char *dst) 76 | { 77 | int x; 78 | int y; 79 | int dst_width = src_width * 2; 80 | int code; 81 | byte rowColors[3]; 82 | byte *e0; 83 | byte *e1; 84 | byte *e2; 85 | byte *e3; 86 | 87 | if (!scale2x_inited) 88 | init_scale2x(); 89 | 90 | // special top case - b is always unknown 91 | { 92 | byte *d; 93 | byte *e; 94 | byte *f; 95 | byte *h; 96 | 97 | e0 = &dst[0]; 98 | e1 = &dst[1]; 99 | e2 = &dst[dst_width]; 100 | e3 = &dst[dst_width + 1]; 101 | e = &src[0]; 102 | f = &src[1]; 103 | h = &src[src_width]; 104 | 105 | // special left case - d is unknown 106 | rowColors[0] = *e; 107 | rowColors[1] = *e; 108 | rowColors[2] = *f; 109 | code = ((*f == *h) << 1); 110 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 111 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 112 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 113 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 114 | e++; 115 | f++; 116 | h++; 117 | d = &src[src_width]; // (src_width - 1) + 1 118 | e0 += 2; 119 | e1 += 2; 120 | e2 += 2; 121 | e3 += 2; 122 | 123 | // normal case 124 | for (x = 1; x < (src_width - 1); x++) { 125 | rowColors[0] = *d; 126 | rowColors[1] = *e; 127 | rowColors[2] = *f; 128 | code = ((*f == *h) << 1 | (*h == *d) << 2); 129 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 130 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 131 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 132 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 133 | d++; 134 | e++; 135 | f++; 136 | h++; 137 | e0 += 2; 138 | e1 += 2; 139 | e2 += 2; 140 | e3 += 2; 141 | } 142 | 143 | // special right case - f is unknown 144 | rowColors[0] = *d; 145 | rowColors[1] = *e; 146 | rowColors[2] = *e; 147 | code = ((*h == *d) << 2); 148 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 149 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 150 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 151 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 152 | } 153 | 154 | // top and bottom always known 155 | for (y = 1; y < (src_height - 1); y++) { 156 | byte *b; 157 | byte *d; 158 | byte *e; 159 | byte *f; 160 | byte *h; 161 | 162 | e0 = &dst[y * dst_width * 2]; 163 | e1 = &dst[y * dst_width * 2 + 1]; 164 | e2 = &dst[y * dst_width * 2 + dst_width]; 165 | e3 = &dst[y * dst_width * 2 + dst_width + 1]; 166 | b = &src[y * src_width - src_width]; 167 | e = &src[y * src_width]; 168 | f = &src[y * src_width + 1]; 169 | h = &src[y * src_width + src_width]; 170 | 171 | // special left case - d is unknown 172 | rowColors[0] = *e; 173 | rowColors[1] = *e; 174 | rowColors[2] = *f; 175 | code = ((*b == *f) << 0 | (*f == *h) << 1); 176 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 177 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 178 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 179 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 180 | b++; 181 | e++; 182 | f++; 183 | h++; 184 | d = &src[y * src_width]; // (y * src_width - 1) + 1 185 | e0 += 2; 186 | e1 += 2; 187 | e2 += 2; 188 | e3 += 2; 189 | 190 | // normal case 191 | for (x = 1; x < (src_width - 1); x++) { 192 | rowColors[0] = *d; 193 | rowColors[1] = *e; 194 | rowColors[2] = *f; 195 | code = ((*b == *f) << 0 | (*f == *h) << 1 | (*h == *d) << 2 | (*d == *b) << 3); 196 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 197 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 198 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 199 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 200 | b++; 201 | d++; 202 | e++; 203 | f++; 204 | h++; 205 | e0 += 2; 206 | e1 += 2; 207 | e2 += 2; 208 | e3 += 2; 209 | } 210 | 211 | // special right case - f is unknown 212 | rowColors[0] = *d; 213 | rowColors[1] = *e; 214 | rowColors[2] = *e; 215 | code = ((*h == *d) << 2 | (*d == *b) << 3); 216 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 217 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 218 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 219 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 220 | } 221 | 222 | // special bottom case - h is always unknown 223 | { 224 | byte *b; 225 | byte *d; 226 | byte *e; 227 | byte *f; 228 | 229 | e0 = &dst[y * dst_width * 2]; 230 | e1 = &dst[y * dst_width * 2 + 1]; 231 | e2 = &dst[y * dst_width * 2 + dst_width]; 232 | e3 = &dst[y * dst_width * 2 + dst_width + 1]; 233 | b = &src[y * src_width - src_width]; 234 | e = &src[y * src_width]; 235 | f = &src[y * src_width + 1]; 236 | 237 | // special left case - d is unknown 238 | rowColors[0] = *e; 239 | rowColors[1] = *e; 240 | rowColors[2] = *f; 241 | code = ((*b == *f) << 0); 242 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 243 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 244 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 245 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 246 | b++; 247 | e++; 248 | f++; 249 | d = &src[y * src_width]; // (y * src_width - 1) + 1 250 | e0 += 2; 251 | e1 += 2; 252 | e2 += 2; 253 | e3 += 2; 254 | 255 | // normal case 256 | for (x = 1; x < (src_width - 1); x++) { 257 | rowColors[0] = *d; 258 | rowColors[1] = *e; 259 | rowColors[2] = *f; 260 | code = ((*b == *f) << 0 | (*d == *b) << 3); 261 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 262 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 263 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 264 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 265 | b++; 266 | d++; 267 | e++; 268 | f++; 269 | e0 += 2; 270 | e1 += 2; 271 | e2 += 2; 272 | e3 += 2; 273 | } 274 | 275 | // special right case - f is unknown 276 | rowColors[0] = *d; 277 | rowColors[1] = *e; 278 | rowColors[2] = *e; 279 | code = ((*d == *b) << 3); 280 | *e0 = rowColors[lookup_map[0 * 16 + code]]; 281 | *e1 = rowColors[lookup_map[1 * 16 + code]]; 282 | *e2 = rowColors[lookup_map[2 * 16 + code]]; 283 | *e3 = rowColors[lookup_map[3 * 16 + code]]; 284 | } 285 | } 286 | -------------------------------------------------------------------------------- /data/objects.txt: -------------------------------------------------------------------------------- 1 | num_images: 80 2 | 3 | image: 1 4 | x: 0 5 | y: 0 6 | width: 17 7 | height: 7 8 | hotspot_x: 0 9 | hotspot_y: 3 10 | 11 | image: 2 12 | x: 32 13 | y: 0 14 | width: 17 15 | height: 8 16 | hotspot_x: 0 17 | hotspot_y: 4 18 | 19 | image: 3 20 | x: 64 21 | y: 0 22 | width: 17 23 | height: 12 24 | hotspot_x: 0 25 | hotspot_y: 8 26 | 27 | image: 4 28 | x: 96 29 | y: 0 30 | width: 17 31 | height: 10 32 | hotspot_x: 0 33 | hotspot_y: 6 34 | 35 | image: 5 36 | x: 128 37 | y: 0 38 | width: 17 39 | height: 8 40 | hotspot_x: 0 41 | hotspot_y: 4 42 | 43 | image: 6 44 | x: 160 45 | y: 0 46 | width: 17 47 | height: 7 48 | hotspot_x: 0 49 | hotspot_y: 3 50 | 51 | image: 7 52 | x: 192 53 | y: 0 54 | width: 12 55 | height: 6 56 | hotspot_x: 5 57 | hotspot_y: 5 58 | 59 | image: 8 60 | x: 224 61 | y: 0 62 | width: 16 63 | height: 8 64 | hotspot_x: 7 65 | hotspot_y: 7 66 | 67 | image: 9 68 | x: 256 69 | y: 0 70 | width: 20 71 | height: 10 72 | hotspot_x: 9 73 | hotspot_y: 9 74 | 75 | image: 10 76 | x: 288 77 | y: 0 78 | width: 23 79 | height: 11 80 | hotspot_x: 11 81 | hotspot_y: 10 82 | 83 | image: 11 84 | x: 320 85 | y: 0 86 | width: 25 87 | height: 12 88 | hotspot_x: 12 89 | hotspot_y: 11 90 | 91 | image: 12 92 | x: 352 93 | y: 0 94 | width: 27 95 | height: 11 96 | hotspot_x: 13 97 | hotspot_y: 10 98 | 99 | image: 13 100 | x: 0 101 | y: 14 102 | width: 29 103 | height: 10 104 | hotspot_x: 14 105 | hotspot_y: 8 106 | 107 | image: 14 108 | x: 32 109 | y: 14 110 | width: 30 111 | height: 7 112 | hotspot_x: 15 113 | hotspot_y: 5 114 | 115 | image: 15 116 | x: 64 117 | y: 14 118 | width: 29 119 | height: 4 120 | hotspot_x: 16 121 | hotspot_y: 2 122 | 123 | image: 16 124 | x: 96 125 | y: 14 126 | width: 2 127 | height: 2 128 | hotspot_x: 0 129 | hotspot_y: 0 130 | 131 | image: 17 132 | x: 128 133 | y: 14 134 | width: 4 135 | height: 4 136 | hotspot_x: 1 137 | hotspot_y: 1 138 | 139 | image: 18 140 | x: 160 141 | y: 14 142 | width: 5 143 | height: 5 144 | hotspot_x: 2 145 | hotspot_y: 2 146 | 147 | image: 19 148 | x: 192 149 | y: 14 150 | width: 5 151 | height: 5 152 | hotspot_x: 2 153 | hotspot_y: 2 154 | 155 | image: 20 156 | x: 224 157 | y: 14 158 | width: 5 159 | height: 5 160 | hotspot_x: 2 161 | hotspot_y: 2 162 | 163 | image: 21 164 | x: 256 165 | y: 14 166 | width: 7 167 | height: 5 168 | hotspot_x: 4 169 | hotspot_y: 4 170 | 171 | image: 22 172 | x: 288 173 | y: 14 174 | width: 8 175 | height: 4 176 | hotspot_x: 5 177 | hotspot_y: 3 178 | 179 | image: 23 180 | x: 320 181 | y: 14 182 | width: 9 183 | height: 3 184 | hotspot_x: 5 185 | hotspot_y: 2 186 | 187 | image: 24 188 | x: 352 189 | y: 14 190 | width: 8 191 | height: 3 192 | hotspot_x: 5 193 | hotspot_y: 1 194 | 195 | image: 25 196 | x: 0 197 | y: 28 198 | width: 8 199 | height: 4 200 | hotspot_x: 5 201 | hotspot_y: 1 202 | 203 | image: 26 204 | x: 32 205 | y: 28 206 | width: 7 207 | height: 5 208 | hotspot_x: 4 209 | hotspot_y: 1 210 | 211 | image: 27 212 | x: 64 213 | y: 28 214 | width: 7 215 | height: 5 216 | hotspot_x: 2 217 | hotspot_y: 4 218 | 219 | image: 28 220 | x: 96 221 | y: 28 222 | width: 8 223 | height: 4 224 | hotspot_x: 2 225 | hotspot_y: 3 226 | 227 | image: 29 228 | x: 128 229 | y: 28 230 | width: 9 231 | height: 3 232 | hotspot_x: 3 233 | hotspot_y: 2 234 | 235 | image: 30 236 | x: 160 237 | y: 28 238 | width: 8 239 | height: 3 240 | hotspot_x: 2 241 | hotspot_y: 1 242 | 243 | image: 31 244 | x: 192 245 | y: 28 246 | width: 8 247 | height: 4 248 | hotspot_x: 2 249 | hotspot_y: 1 250 | 251 | image: 32 252 | x: 224 253 | y: 28 254 | width: 7 255 | height: 5 256 | hotspot_x: 2 257 | hotspot_y: 1 258 | 259 | image: 33 260 | x: 256 261 | y: 28 262 | width: 7 263 | height: 5 264 | hotspot_x: 4 265 | hotspot_y: 4 266 | 267 | image: 34 268 | x: 288 269 | y: 28 270 | width: 8 271 | height: 4 272 | hotspot_x: 5 273 | hotspot_y: 3 274 | 275 | image: 35 276 | x: 320 277 | y: 28 278 | width: 9 279 | height: 3 280 | hotspot_x: 5 281 | hotspot_y: 2 282 | 283 | image: 36 284 | x: 352 285 | y: 28 286 | width: 8 287 | height: 3 288 | hotspot_x: 5 289 | hotspot_y: 1 290 | 291 | image: 37 292 | x: 0 293 | y: 42 294 | width: 8 295 | height: 4 296 | hotspot_x: 5 297 | hotspot_y: 1 298 | 299 | image: 38 300 | x: 32 301 | y: 42 302 | width: 7 303 | height: 5 304 | hotspot_x: 4 305 | hotspot_y: 1 306 | 307 | image: 39 308 | x: 64 309 | y: 42 310 | width: 7 311 | height: 5 312 | hotspot_x: 2 313 | hotspot_y: 4 314 | 315 | image: 40 316 | x: 96 317 | y: 42 318 | width: 8 319 | height: 4 320 | hotspot_x: 2 321 | hotspot_y: 3 322 | 323 | image: 41 324 | x: 128 325 | y: 42 326 | width: 9 327 | height: 3 328 | hotspot_x: 3 329 | hotspot_y: 2 330 | 331 | image: 42 332 | x: 160 333 | y: 42 334 | width: 8 335 | height: 3 336 | hotspot_x: 2 337 | hotspot_y: 1 338 | 339 | image: 43 340 | x: 192 341 | y: 42 342 | width: 8 343 | height: 4 344 | hotspot_x: 2 345 | hotspot_y: 1 346 | 347 | image: 44 348 | x: 224 349 | y: 42 350 | width: 7 351 | height: 5 352 | hotspot_x: 2 353 | hotspot_y: 1 354 | 355 | image: 45 356 | x: 256 357 | y: 42 358 | width: 6 359 | height: 4 360 | hotspot_x: 3 361 | hotspot_y: 2 362 | 363 | image: 46 364 | x: 288 365 | y: 42 366 | width: 6 367 | height: 5 368 | hotspot_x: 3 369 | hotspot_y: 3 370 | 371 | image: 47 372 | x: 320 373 | y: 42 374 | width: 4 375 | height: 6 376 | hotspot_x: 2 377 | hotspot_y: 3 378 | 379 | image: 48 380 | x: 352 381 | y: 42 382 | width: 5 383 | height: 6 384 | hotspot_x: 2 385 | hotspot_y: 3 386 | 387 | image: 49 388 | x: 0 389 | y: 56 390 | width: 6 391 | height: 4 392 | hotspot_x: 2 393 | hotspot_y: 2 394 | 395 | image: 50 396 | x: 32 397 | y: 56 398 | width: 6 399 | height: 5 400 | hotspot_x: 2 401 | hotspot_y: 2 402 | 403 | image: 51 404 | x: 64 405 | y: 56 406 | width: 4 407 | height: 6 408 | hotspot_x: 1 409 | hotspot_y: 2 410 | 411 | image: 52 412 | x: 96 413 | y: 56 414 | width: 5 415 | height: 6 416 | hotspot_x: 2 417 | hotspot_y: 3 418 | 419 | image: 53 420 | x: 128 421 | y: 56 422 | width: 6 423 | height: 4 424 | hotspot_x: 3 425 | hotspot_y: 2 426 | 427 | image: 54 428 | x: 160 429 | y: 56 430 | width: 6 431 | height: 5 432 | hotspot_x: 3 433 | hotspot_y: 2 434 | 435 | image: 55 436 | x: 192 437 | y: 56 438 | width: 4 439 | height: 6 440 | hotspot_x: 2 441 | hotspot_y: 3 442 | 443 | image: 56 444 | x: 224 445 | y: 56 446 | width: 5 447 | height: 6 448 | hotspot_x: 3 449 | hotspot_y: 3 450 | 451 | image: 57 452 | x: 256 453 | y: 56 454 | width: 6 455 | height: 4 456 | hotspot_x: 4 457 | hotspot_y: 2 458 | 459 | image: 58 460 | x: 288 461 | y: 56 462 | width: 6 463 | height: 5 464 | hotspot_x: 4 465 | hotspot_y: 3 466 | 467 | image: 59 468 | x: 320 469 | y: 56 470 | width: 4 471 | height: 6 472 | hotspot_x: 3 473 | hotspot_y: 3 474 | 475 | image: 60 476 | x: 352 477 | y: 56 478 | width: 5 479 | height: 6 480 | hotspot_x: 3 481 | hotspot_y: 3 482 | 483 | image: 61 484 | x: 0 485 | y: 70 486 | width: 6 487 | height: 4 488 | hotspot_x: 3 489 | hotspot_y: 2 490 | 491 | image: 62 492 | x: 32 493 | y: 70 494 | width: 6 495 | height: 5 496 | hotspot_x: 3 497 | hotspot_y: 2 498 | 499 | image: 63 500 | x: 64 501 | y: 70 502 | width: 4 503 | height: 6 504 | hotspot_x: 3 505 | hotspot_y: 2 506 | 507 | image: 64 508 | x: 96 509 | y: 70 510 | width: 5 511 | height: 6 512 | hotspot_x: 4 513 | hotspot_y: 2 514 | 515 | image: 65 516 | x: 128 517 | y: 70 518 | width: 6 519 | height: 4 520 | hotspot_x: 5 521 | hotspot_y: 1 522 | 523 | image: 66 524 | x: 160 525 | y: 70 526 | width: 6 527 | height: 5 528 | hotspot_x: 5 529 | hotspot_y: 2 530 | 531 | image: 67 532 | x: 192 533 | y: 70 534 | width: 4 535 | height: 6 536 | hotspot_x: 4 537 | hotspot_y: 3 538 | 539 | image: 68 540 | x: 224 541 | y: 70 542 | width: 5 543 | height: 6 544 | hotspot_x: 3 545 | hotspot_y: 3 546 | 547 | image: 69 548 | x: 256 549 | y: 70 550 | width: 6 551 | height: 4 552 | hotspot_x: 3 553 | hotspot_y: 2 554 | 555 | image: 70 556 | x: 288 557 | y: 70 558 | width: 6 559 | height: 5 560 | hotspot_x: 3 561 | hotspot_y: 2 562 | 563 | image: 71 564 | x: 320 565 | y: 70 566 | width: 4 567 | height: 6 568 | hotspot_x: 2 569 | hotspot_y: 2 570 | 571 | image: 72 572 | x: 352 573 | y: 70 574 | width: 5 575 | height: 6 576 | hotspot_x: 4 577 | hotspot_y: 2 578 | 579 | image: 73 580 | x: 0 581 | y: 84 582 | width: 6 583 | height: 4 584 | hotspot_x: 5 585 | hotspot_y: 1 586 | 587 | image: 74 588 | x: 32 589 | y: 84 590 | width: 6 591 | height: 5 592 | hotspot_x: 5 593 | hotspot_y: 2 594 | 595 | image: 75 596 | x: 64 597 | y: 84 598 | width: 4 599 | height: 6 600 | hotspot_x: 3 601 | hotspot_y: 3 602 | 603 | image: 76 604 | x: 96 605 | y: 84 606 | width: 5 607 | height: 6 608 | hotspot_x: 3 609 | hotspot_y: 3 610 | 611 | image: 77 612 | x: 128 613 | y: 84 614 | width: 5 615 | height: 4 616 | hotspot_x: 2 617 | hotspot_y: 1 618 | 619 | image: 78 620 | x: 160 621 | y: 84 622 | width: 4 623 | height: 4 624 | hotspot_x: 2 625 | hotspot_y: 1 626 | 627 | image: 79 628 | x: 192 629 | y: 84 630 | width: 2 631 | height: 3 632 | hotspot_x: 1 633 | hotspot_y: 1 634 | 635 | image: 80 636 | x: 224 637 | y: 84 638 | width: 1 639 | height: 1 640 | hotspot_x: 0 641 | hotspot_y: 0 642 | 643 | -------------------------------------------------------------------------------- /data/font.txt: -------------------------------------------------------------------------------- 1 | num_images: 81 2 | 3 | image: 1 4 | x: 0 5 | y: 0 6 | width: 4 7 | height: 10 8 | hotspot_x: 0 9 | hotspot_y: -1 10 | 11 | image: 2 12 | x: 14 13 | y: 0 14 | width: 5 15 | height: 4 16 | hotspot_x: 0 17 | hotspot_y: -1 18 | 19 | image: 3 20 | x: 28 21 | y: 0 22 | width: 3 23 | height: 4 24 | hotspot_x: 0 25 | hotspot_y: -1 26 | 27 | image: 4 28 | x: 42 29 | y: 0 30 | width: 5 31 | height: 12 32 | hotspot_x: 0 33 | hotspot_y: 0 34 | 35 | image: 5 36 | x: 56 37 | y: 0 38 | width: 6 39 | height: 12 40 | hotspot_x: 0 41 | hotspot_y: 0 42 | 43 | image: 6 44 | x: 70 45 | y: 0 46 | width: 3 47 | height: 5 48 | hotspot_x: 0 49 | hotspot_y: -8 50 | 51 | image: 7 52 | x: 84 53 | y: 0 54 | width: 5 55 | height: 3 56 | hotspot_x: 0 57 | hotspot_y: -4 58 | 59 | image: 8 60 | x: 98 61 | y: 0 62 | width: 3 63 | height: 3 64 | hotspot_x: 0 65 | hotspot_y: -8 66 | 67 | image: 9 68 | x: 112 69 | y: 0 70 | width: 6 71 | height: 10 72 | hotspot_x: 0 73 | hotspot_y: -1 74 | 75 | image: 10 76 | x: 126 77 | y: 0 78 | width: 7 79 | height: 10 80 | hotspot_x: 0 81 | hotspot_y: -1 82 | 83 | image: 11 84 | x: 140 85 | y: 0 86 | width: 5 87 | height: 10 88 | hotspot_x: 0 89 | hotspot_y: -1 90 | 91 | image: 12 92 | x: 154 93 | y: 0 94 | width: 7 95 | height: 10 96 | hotspot_x: 0 97 | hotspot_y: -1 98 | 99 | image: 13 100 | x: 168 101 | y: 0 102 | width: 7 103 | height: 10 104 | hotspot_x: 0 105 | hotspot_y: -1 106 | 107 | image: 14 108 | x: 182 109 | y: 0 110 | width: 7 111 | height: 10 112 | hotspot_x: 0 113 | hotspot_y: -1 114 | 115 | image: 15 116 | x: 196 117 | y: 0 118 | width: 7 119 | height: 10 120 | hotspot_x: 0 121 | hotspot_y: -1 122 | 123 | image: 16 124 | x: 210 125 | y: 0 126 | width: 7 127 | height: 10 128 | hotspot_x: 0 129 | hotspot_y: -1 130 | 131 | image: 17 132 | x: 224 133 | y: 0 134 | width: 7 135 | height: 10 136 | hotspot_x: 0 137 | hotspot_y: -1 138 | 139 | image: 18 140 | x: 238 141 | y: 0 142 | width: 7 143 | height: 10 144 | hotspot_x: 0 145 | hotspot_y: -1 146 | 147 | image: 19 148 | x: 252 149 | y: 0 150 | width: 7 151 | height: 10 152 | hotspot_x: 0 153 | hotspot_y: -1 154 | 155 | image: 20 156 | x: 266 157 | y: 0 158 | width: 4 159 | height: 7 160 | hotspot_x: 0 161 | hotspot_y: -3 162 | 163 | image: 21 164 | x: 280 165 | y: 0 166 | width: 4 167 | height: 9 168 | hotspot_x: 0 169 | hotspot_y: -3 170 | 171 | image: 22 172 | x: 294 173 | y: 0 174 | width: 12 175 | height: 11 176 | hotspot_x: 0 177 | hotspot_y: 0 178 | 179 | image: 23 180 | x: 308 181 | y: 0 182 | width: 9 183 | height: 9 184 | hotspot_x: 0 185 | hotspot_y: -1 186 | 187 | image: 24 188 | x: 322 189 | y: 0 190 | width: 9 191 | height: 9 192 | hotspot_x: 0 193 | hotspot_y: -1 194 | 195 | image: 25 196 | x: 336 197 | y: 0 198 | width: 9 199 | height: 10 200 | hotspot_x: 0 201 | hotspot_y: -1 202 | 203 | image: 26 204 | x: 350 205 | y: 0 206 | width: 9 207 | height: 9 208 | hotspot_x: 0 209 | hotspot_y: -1 210 | 211 | image: 27 212 | x: 364 213 | y: 0 214 | width: 9 215 | height: 9 216 | hotspot_x: 0 217 | hotspot_y: -1 218 | 219 | image: 28 220 | x: 378 221 | y: 0 222 | width: 8 223 | height: 9 224 | hotspot_x: 0 225 | hotspot_y: -1 226 | 227 | image: 29 228 | x: 0 229 | y: 14 230 | width: 9 231 | height: 10 232 | hotspot_x: 0 233 | hotspot_y: -1 234 | 235 | image: 30 236 | x: 14 237 | y: 14 238 | width: 9 239 | height: 9 240 | hotspot_x: 0 241 | hotspot_y: -1 242 | 243 | image: 31 244 | x: 28 245 | y: 14 246 | width: 4 247 | height: 9 248 | hotspot_x: 0 249 | hotspot_y: -1 250 | 251 | image: 32 252 | x: 42 253 | y: 14 254 | width: 8 255 | height: 10 256 | hotspot_x: 0 257 | hotspot_y: -1 258 | 259 | image: 33 260 | x: 56 261 | y: 14 262 | width: 10 263 | height: 9 264 | hotspot_x: 0 265 | hotspot_y: -1 266 | 267 | image: 34 268 | x: 70 269 | y: 14 270 | width: 7 271 | height: 9 272 | hotspot_x: 0 273 | hotspot_y: -1 274 | 275 | image: 35 276 | x: 84 277 | y: 14 278 | width: 11 279 | height: 9 280 | hotspot_x: 0 281 | hotspot_y: -1 282 | 283 | image: 36 284 | x: 98 285 | y: 14 286 | width: 10 287 | height: 9 288 | hotspot_x: 0 289 | hotspot_y: -1 290 | 291 | image: 37 292 | x: 112 293 | y: 14 294 | width: 9 295 | height: 10 296 | hotspot_x: 0 297 | hotspot_y: -1 298 | 299 | image: 38 300 | x: 126 301 | y: 14 302 | width: 9 303 | height: 9 304 | hotspot_x: 0 305 | hotspot_y: -1 306 | 307 | image: 39 308 | x: 140 309 | y: 14 310 | width: 9 311 | height: 10 312 | hotspot_x: 0 313 | hotspot_y: -1 314 | 315 | image: 40 316 | x: 154 317 | y: 14 318 | width: 9 319 | height: 9 320 | hotspot_x: 0 321 | hotspot_y: -1 322 | 323 | image: 41 324 | x: 168 325 | y: 14 326 | width: 8 327 | height: 10 328 | hotspot_x: 0 329 | hotspot_y: -1 330 | 331 | image: 42 332 | x: 182 333 | y: 14 334 | width: 8 335 | height: 9 336 | hotspot_x: 0 337 | hotspot_y: -1 338 | 339 | image: 43 340 | x: 196 341 | y: 14 342 | width: 9 343 | height: 10 344 | hotspot_x: 0 345 | hotspot_y: -1 346 | 347 | image: 44 348 | x: 210 349 | y: 14 350 | width: 9 351 | height: 9 352 | hotspot_x: 0 353 | hotspot_y: -1 354 | 355 | image: 45 356 | x: 224 357 | y: 14 358 | width: 12 359 | height: 9 360 | hotspot_x: 0 361 | hotspot_y: -1 362 | 363 | image: 46 364 | x: 238 365 | y: 14 366 | width: 9 367 | height: 9 368 | hotspot_x: 0 369 | hotspot_y: -1 370 | 371 | image: 47 372 | x: 252 373 | y: 14 374 | width: 8 375 | height: 9 376 | hotspot_x: 0 377 | hotspot_y: -1 378 | 379 | image: 48 380 | x: 266 381 | y: 14 382 | width: 9 383 | height: 9 384 | hotspot_x: 0 385 | hotspot_y: -1 386 | 387 | image: 49 388 | x: 280 389 | y: 14 390 | width: 7 391 | height: 7 392 | hotspot_x: 0 393 | hotspot_y: -3 394 | 395 | image: 50 396 | x: 294 397 | y: 14 398 | width: 8 399 | height: 9 400 | hotspot_x: 0 401 | hotspot_y: -1 402 | 403 | image: 51 404 | x: 308 405 | y: 14 406 | width: 6 407 | height: 7 408 | hotspot_x: 0 409 | hotspot_y: -3 410 | 411 | image: 52 412 | x: 322 413 | y: 14 414 | width: 8 415 | height: 9 416 | hotspot_x: 0 417 | hotspot_y: -1 418 | 419 | image: 53 420 | x: 336 421 | y: 14 422 | width: 7 423 | height: 7 424 | hotspot_x: 0 425 | hotspot_y: -3 426 | 427 | image: 54 428 | x: 350 429 | y: 14 430 | width: 5 431 | height: 9 432 | hotspot_x: 0 433 | hotspot_y: -1 434 | 435 | image: 55 436 | x: 364 437 | y: 14 438 | width: 8 439 | height: 10 440 | hotspot_x: 0 441 | hotspot_y: -3 442 | 443 | image: 56 444 | x: 378 445 | y: 14 446 | width: 7 447 | height: 9 448 | hotspot_x: 0 449 | hotspot_y: -1 450 | 451 | image: 57 452 | x: 0 453 | y: 28 454 | width: 4 455 | height: 9 456 | hotspot_x: 0 457 | hotspot_y: -1 458 | 459 | image: 58 460 | x: 14 461 | y: 28 462 | width: 5 463 | height: 12 464 | hotspot_x: 0 465 | hotspot_y: -1 466 | 467 | image: 59 468 | x: 28 469 | y: 28 470 | width: 8 471 | height: 9 472 | hotspot_x: 0 473 | hotspot_y: -1 474 | 475 | image: 60 476 | x: 42 477 | y: 28 478 | width: 4 479 | height: 9 480 | hotspot_x: 0 481 | hotspot_y: -1 482 | 483 | image: 61 484 | x: 56 485 | y: 28 486 | width: 11 487 | height: 7 488 | hotspot_x: 0 489 | hotspot_y: -3 490 | 491 | image: 62 492 | x: 70 493 | y: 28 494 | width: 8 495 | height: 7 496 | hotspot_x: 0 497 | hotspot_y: -3 498 | 499 | image: 63 500 | x: 84 501 | y: 28 502 | width: 7 503 | height: 7 504 | hotspot_x: 0 505 | hotspot_y: -3 506 | 507 | image: 64 508 | x: 98 509 | y: 28 510 | width: 8 511 | height: 10 512 | hotspot_x: 0 513 | hotspot_y: -3 514 | 515 | image: 65 516 | x: 112 517 | y: 28 518 | width: 8 519 | height: 10 520 | hotspot_x: 0 521 | hotspot_y: -3 522 | 523 | image: 66 524 | x: 126 525 | y: 28 526 | width: 6 527 | height: 7 528 | hotspot_x: 0 529 | hotspot_y: -3 530 | 531 | image: 67 532 | x: 140 533 | y: 28 534 | width: 7 535 | height: 7 536 | hotspot_x: 0 537 | hotspot_y: -3 538 | 539 | image: 68 540 | x: 154 541 | y: 28 542 | width: 5 543 | height: 9 544 | hotspot_x: 0 545 | hotspot_y: -1 546 | 547 | image: 69 548 | x: 168 549 | y: 28 550 | width: 7 551 | height: 7 552 | hotspot_x: 0 553 | hotspot_y: -3 554 | 555 | image: 70 556 | x: 182 557 | y: 28 558 | width: 7 559 | height: 7 560 | hotspot_x: 0 561 | hotspot_y: -3 562 | 563 | image: 71 564 | x: 196 565 | y: 28 566 | width: 10 567 | height: 7 568 | hotspot_x: 0 569 | hotspot_y: -3 570 | 571 | image: 72 572 | x: 210 573 | y: 28 574 | width: 8 575 | height: 7 576 | hotspot_x: 0 577 | hotspot_y: -3 578 | 579 | image: 73 580 | x: 224 581 | y: 28 582 | width: 8 583 | height: 10 584 | hotspot_x: 0 585 | hotspot_y: -3 586 | 587 | image: 74 588 | x: 238 589 | y: 28 590 | width: 7 591 | height: 7 592 | hotspot_x: 0 593 | hotspot_y: -3 594 | 595 | image: 75 596 | x: 252 597 | y: 28 598 | width: 6 599 | height: 3 600 | hotspot_x: 0 601 | hotspot_y: -4 602 | 603 | image: 76 604 | x: 266 605 | y: 28 606 | width: 7 607 | height: 9 608 | hotspot_x: 0 609 | hotspot_y: -1 610 | 611 | image: 77 612 | x: 280 613 | y: 28 614 | width: 7 615 | height: 10 616 | hotspot_x: 0 617 | hotspot_y: 0 618 | 619 | image: 78 620 | x: 294 621 | y: 28 622 | width: 9 623 | height: 11 624 | hotspot_x: 0 625 | hotspot_y: 1 626 | 627 | image: 79 628 | x: 308 629 | y: 28 630 | width: 9 631 | height: 11 632 | hotspot_x: 0 633 | hotspot_y: 1 634 | 635 | image: 80 636 | x: 322 637 | y: 28 638 | width: 7 639 | height: 9 640 | hotspot_x: 0 641 | hotspot_y: -1 642 | 643 | image: 81 644 | x: 336 645 | y: 28 646 | width: 9 647 | height: 11 648 | hotspot_x: 0 649 | hotspot_y: 1 650 | 651 | -------------------------------------------------------------------------------- /src/include/globals.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * globals.h 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * Copyright (C) 2015 Côme Chilliet 10 | * 11 | * This file is part of Jump 'n Bump. 12 | * 13 | * Jump 'n Bump is free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Jump 'n Bump is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | */ 27 | 28 | #ifndef __GLOBALS_H 29 | #define __GLOBALS_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | #include "config.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #ifndef _WIN32 42 | #include 43 | #endif 44 | #include 45 | #include 46 | #include 47 | 48 | #ifdef DOS 49 | # include 50 | # include 51 | # include 52 | # include 53 | #endif 54 | 55 | #ifdef _WIN32 56 | # define WIN32_LEAN_AND_MEAN 57 | # include 58 | # include 59 | # include 60 | # include "SDL.h" 61 | # if USE_SDL_MIXER 62 | # include "SDL_mixer.h" 63 | # endif 64 | #else 65 | # ifdef USE_SDL 66 | # include 67 | # include "SDL.h" 68 | # if USE_SDL_MIXER 69 | # include "SDL_mixer.h" 70 | # endif 71 | # endif 72 | #endif 73 | 74 | #define JNB_MAX_PLAYERS 4 75 | 76 | #define JNB_END_SCORE 100 77 | 78 | #define JNB_INETPORT 11111 79 | 80 | extern int client_player_num; 81 | void tellServerPlayerMoved(int playerid, int movement_type, int newval); 82 | #define MOVEMENT_LEFT 1 83 | #define MOVEMENT_RIGHT 2 84 | #define MOVEMENT_UP 3 85 | 86 | #define JNB_VERSION "@CMAKE_PROJECT_VERSION@-dev" 87 | 88 | #define JNB_WIDTH 400 89 | #define JNB_HEIGHT 256 90 | 91 | extern int screen_width; 92 | extern int screen_height; 93 | extern int screen_pitch; 94 | extern int scale_up; 95 | 96 | extern int ai[JNB_MAX_PLAYERS]; 97 | 98 | #ifndef USE_SDL 99 | #define KEY_PL1_LEFT 0xcb 100 | #define KEY_PL1_RIGHT 0xcd 101 | #define KEY_PL1_JUMP 0xc8 102 | #define KEY_PL2_LEFT 0x1e 103 | #define KEY_PL2_RIGHT 0x20 104 | #define KEY_PL2_JUMP 0x11 105 | #else 106 | #define KEY_PL1_LEFT SDL_SCANCODE_LEFT 107 | #define KEY_PL1_RIGHT SDL_SCANCODE_RIGHT 108 | #define KEY_PL1_JUMP SDL_SCANCODE_UP 109 | #define KEY_PL2_LEFT SDL_SCANCODE_A 110 | #define KEY_PL2_RIGHT SDL_SCANCODE_D 111 | #define KEY_PL2_JUMP SDL_SCANCODE_W 112 | #define KEY_PL3_LEFT SDL_SCANCODE_J 113 | #define KEY_PL3_RIGHT SDL_SCANCODE_L 114 | #define KEY_PL3_JUMP SDL_SCANCODE_I 115 | #define KEY_PL4_LEFT SDL_SCANCODE_KP_4 116 | #define KEY_PL4_RIGHT SDL_SCANCODE_KP_6 117 | #define KEY_PL4_JUMP SDL_SCANCODE_KP_8 118 | #endif 119 | 120 | #define NUM_POBS 200 121 | #define NUM_OBJECTS 200 122 | #define NUM_FLIES 20 123 | #define NUM_LEFTOVERS 50 124 | 125 | #define OBJ_SPRING 0 126 | #define OBJ_SPLASH 1 127 | #define OBJ_SMOKE 2 128 | #define OBJ_YEL_BUTFLY 3 129 | #define OBJ_PINK_BUTFLY 4 130 | #define OBJ_FUR 5 131 | #define OBJ_FLESH 6 132 | #define OBJ_FLESH_TRACE 7 133 | 134 | #define OBJ_ANIM_SPRING 0 135 | #define OBJ_ANIM_SPLASH 1 136 | #define OBJ_ANIM_SMOKE 2 137 | #define OBJ_ANIM_YEL_BUTFLY_RIGHT 3 138 | #define OBJ_ANIM_YEL_BUTFLY_LEFT 4 139 | #define OBJ_ANIM_PINK_BUTFLY_RIGHT 5 140 | #define OBJ_ANIM_PINK_BUTFLY_LEFT 6 141 | #define OBJ_ANIM_FLESH_TRACE 7 142 | 143 | #define MOD_MENU 0 144 | #define MOD_GAME 1 145 | #define MOD_SCORES 2 146 | 147 | #define SFX_JUMP 0 148 | #define SFX_LAND 1 149 | #define SFX_DEATH 2 150 | #define SFX_SPRING 3 151 | #define SFX_SPLASH 4 152 | #define SFX_FLY 5 153 | 154 | #define NUM_SFX 6 155 | 156 | #define SFX_JUMP_FREQ 15000 157 | #define SFX_LAND_FREQ 15000 158 | #define SFX_DEATH_FREQ 20000 159 | #define SFX_SPRING_FREQ 15000 160 | #define SFX_SPLASH_FREQ 12000 161 | #define SFX_FLY_FREQ 12000 162 | 163 | #define BAN_VOID 0 164 | #define BAN_SOLID 1 165 | #define BAN_WATER 2 166 | #define BAN_ICE 3 167 | #define BAN_SPRING 4 168 | 169 | #ifndef DATA_PATH 170 | #ifdef __APPLE__ 171 | #define DATA_PATH "data/jumpbump.dat" 172 | #elif _WIN32 173 | #define DATA_PATH "data/jumpbump.dat" 174 | #else 175 | #define DATA_PATH "@GAMEDATADIR@/jumpnbump/jumpbump.dat" 176 | #endif 177 | #endif 178 | 179 | typedef struct { 180 | int num_images; 181 | int *width; 182 | int *height; 183 | int *hs_x; 184 | int *hs_y; 185 | void **data; 186 | void **orig_data; 187 | } gob_t; 188 | 189 | typedef struct { 190 | int joy_enabled, mouse_enabled; 191 | int no_sound, music_no_sound, no_gore; 192 | char error_str[256]; 193 | int draw_page, view_page; 194 | struct { 195 | int num_pobs; 196 | struct { 197 | int x, y; 198 | int image; 199 | gob_t *pob_data; 200 | int back_buf_ofs; 201 | } pobs[NUM_POBS]; 202 | } page_info[2]; 203 | void *pob_backbuf[2]; 204 | } main_info_t; 205 | 206 | typedef struct { 207 | int action_left,action_up,action_right; 208 | int enabled, dead_flag; 209 | int bumps; 210 | int bumped[JNB_MAX_PLAYERS]; 211 | int x, y; 212 | int x_add, y_add; 213 | int direction, jump_ready, jump_abort, in_water; 214 | int anim, frame, frame_tick, image; 215 | } player_t; 216 | 217 | typedef struct { 218 | int num_frames; 219 | int restart_frame; 220 | struct { 221 | int image; 222 | int ticks; 223 | } frame[4]; 224 | } player_anim_t; 225 | 226 | typedef struct { 227 | int used, type; 228 | int x, y; 229 | int x_add, y_add; 230 | int x_acc, y_acc; 231 | int anim; 232 | int frame, ticks; 233 | int image; 234 | } object_t; 235 | 236 | typedef struct { 237 | int x, y; 238 | int raw_x, raw_y; 239 | int but1, but2; 240 | struct { 241 | int x1, x2, x3; 242 | int y1, y2, y3; 243 | } calib_data; 244 | } joy_t; 245 | 246 | typedef struct { 247 | int but1, but2, but3; 248 | } mouse_t; 249 | 250 | extern main_info_t main_info; 251 | extern player_t player[JNB_MAX_PLAYERS]; 252 | extern player_anim_t player_anims[7]; 253 | extern object_t objects[NUM_OBJECTS]; 254 | extern joy_t joy; 255 | extern mouse_t mouse; 256 | 257 | extern char datfile_name[2048]; 258 | 259 | extern unsigned char *background_pic; 260 | extern unsigned char *mask_pic; 261 | 262 | extern gob_t rabbit_gobs; 263 | extern gob_t font_gobs; 264 | extern gob_t object_gobs; 265 | extern gob_t number_gobs; 266 | 267 | 268 | /* main.c */ 269 | 270 | extern int endscore_reached; 271 | 272 | void steer_players(void); 273 | void position_player(int player_num); 274 | void add_object(int type, int x, int y, int x_add, int y_add, int anim, int frame); 275 | void update_objects(void); 276 | int add_pob(int page, int x, int y, int image, gob_t *pob_data); 277 | void draw_flies(int page); 278 | void draw_pobs(int page); 279 | void redraw_flies_background(int page); 280 | void redraw_pob_backgrounds(int page); 281 | int add_leftovers(int page, int x, int y, int image, gob_t *pob_data); 282 | void draw_leftovers(int page); 283 | int init_level(int level, char *pal); 284 | void deinit_level(void); 285 | int init_program(int argc, char *argv[], char *pal); 286 | void deinit_program(void); 287 | unsigned short rnd(unsigned short max); 288 | int read_level(void); 289 | unsigned char *dat_open(char *file_name); 290 | int dat_filelen(char *file_name); 291 | void write_calib_data(void); 292 | 293 | 294 | /* input.c */ 295 | 296 | void update_player_actions(void); 297 | void init_inputs(void); 298 | int calib_joy(int type); 299 | 300 | /* menu.c */ 301 | 302 | int menu(void); 303 | int menu_init(void); 304 | void menu_deinit(void); 305 | 306 | 307 | /* gfx.c */ 308 | 309 | void set_scaling(int scale); 310 | void open_screen(void); 311 | void close_screen(void); 312 | void wait_vrt(int mix); 313 | void draw_begin(void); 314 | void draw_end(void); 315 | void flippage(int page); 316 | void draw_begin(void); 317 | void draw_end(void); 318 | void clear_lines(int page, int y, int count, int color); 319 | int get_color(int color, char pal[768]); 320 | int get_pixel(int page, int x, int y); 321 | void set_pixel(int page, int x, int y, int color); 322 | void setpalette(int index, int count, char *palette); 323 | void fillpalette(int red, int green, int blue); 324 | #ifdef DOS 325 | void get_block(char page, short x, short y, short width, short height, char *buffer); 326 | void put_block(char page, short x, short y, short width, short height, char *buffer); 327 | #else 328 | void get_block(int page, int x, int y, int width, int height, void *buffer); 329 | void put_block(int page, int x, int y, int width, int height, void *buffer); 330 | #endif 331 | void put_text(int page, int x, int y, char *text, int align); 332 | void put_pob(int page, int x, int y, int image, gob_t *gob, int mask, void *mask_pic); 333 | int pob_width(int image, gob_t *gob); 334 | int pob_height(int image, gob_t *gob); 335 | int pob_hs_x(int image, gob_t *gob); 336 | int pob_hs_y(int image, gob_t *gob); 337 | int read_pcx(unsigned char * handle, void *buffer, int buf_len, char *pal); 338 | void register_background(unsigned char *pixels, char pal[768]); 339 | int register_gob(unsigned char *handle, gob_t *gob, int len); 340 | void recalculate_gob(gob_t *gob, char pal[768]); 341 | void register_mask(void *pixels); 342 | 343 | /* gfx.c */ 344 | 345 | #ifdef USE_SDL 346 | /* long filelength(int handle); */ 347 | void fs_toggle(); 348 | int intr_sysupdate(); 349 | #endif 350 | 351 | /* interrpt.c */ 352 | 353 | extern char last_keys[50]; 354 | 355 | int hook_keyb_handler(void); 356 | void remove_keyb_handler(void); 357 | int key_pressed(int key); 358 | int addkey(unsigned int key); 359 | 360 | /* sound-linux.c */ 361 | #ifdef LINUX 362 | 363 | 364 | #endif 365 | 366 | #ifdef __cplusplus 367 | } 368 | #endif 369 | 370 | #endif 371 | -------------------------------------------------------------------------------- /src/tools/gobpack.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | typedef struct { 6 | int num_images; 7 | int *width; 8 | int *height; 9 | int *hs_x; 10 | int *hs_y; 11 | void **data; 12 | void **orig_data; 13 | } gob_t; 14 | 15 | static void read_pcx(FILE *handle, void *buf, int buf_len, char *pal) 16 | { 17 | unsigned char *buffer = buf; 18 | if (buffer) { 19 | short c1; 20 | short a, b; 21 | long ofs1; 22 | fseek(handle, 128, SEEK_CUR); 23 | ofs1 = 0; 24 | while (ofs1 < buf_len) { 25 | a = fgetc(handle); 26 | if ((a & 0xc0) == 0xc0) { 27 | b = fgetc(handle); 28 | a &= 0x3f; 29 | for (c1 = 0; c1 < a && ofs1 < buf_len; c1++) 30 | buffer[ofs1++] = (char) b; 31 | } else 32 | buffer[ofs1++] = (char) a; 33 | } 34 | if (pal) { 35 | fseek(handle, 1, SEEK_CUR); 36 | for (c1 = 0; c1 < 768; c1++) 37 | pal[c1] = fgetc(handle) >> 2; 38 | } 39 | } 40 | } 41 | 42 | static void write_pcx(FILE *pcxfile, unsigned char *data, int width, int height, unsigned char *palette) 43 | { 44 | int i; 45 | 46 | fputc(0x0a, pcxfile); /* manufacturer */ 47 | fputc(5, pcxfile); /* version */ 48 | fputc(1, pcxfile); /* encoding */ 49 | fputc(8, pcxfile); /* bits_per_pixel */ 50 | fputc(0, pcxfile); /* xmin */ 51 | fputc(0, pcxfile); 52 | fputc(0, pcxfile); /* ymin */ 53 | fputc(0, pcxfile); 54 | fputc((width - 1) & 0xff, pcxfile); /* xmax */ 55 | fputc(((width - 1) >> 8) & 0xff, pcxfile); 56 | fputc((height - 1) & 0xff, pcxfile); /* ymax */ 57 | fputc(((height - 1) >> 8) & 0xff, pcxfile); 58 | fputc(width & 0xff, pcxfile); /* hres */ 59 | fputc((width >> 8) & 0xff, pcxfile); 60 | fputc(height & 0xff, pcxfile); /* vres */ 61 | fputc((height >> 8) & 0xff, pcxfile); 62 | for (i = 0; i < 48; i++) /* palette */ 63 | fputc(0, pcxfile); 64 | fputc(0, pcxfile); /* reserved */ 65 | fputc(1, pcxfile); /* color_planes */ 66 | fputc(width & 0xff, pcxfile); /* bytes_per_line */ 67 | fputc((width >> 8) & 0xff, pcxfile); 68 | fputc(1 & 0xff, pcxfile); /* palette_type */ 69 | fputc((1 >> 8) & 0xff, pcxfile); 70 | for (i = 0; i < 58; i++) /* filler */ 71 | fputc(0, pcxfile); 72 | 73 | /* pack the image */ 74 | 75 | for (i = 0; i < width * height; i++) 76 | if ((*data & 0xc0) != 0xc0) 77 | fputc(*data++, pcxfile); 78 | else { 79 | fputc(0xc1, pcxfile); 80 | fputc(*data++, pcxfile); 81 | } 82 | 83 | /* write the palette */ 84 | 85 | fputc(0x0c, pcxfile); /* palette ID byte */ 86 | if (palette) 87 | for (i = 0; i < 768; i++) 88 | fputc(*palette++, pcxfile); 89 | else 90 | for (i = 0; i < 768; i++) 91 | fputc(i / 3, pcxfile); 92 | } 93 | 94 | int read_gob(FILE *handle, gob_t *gob, size_t len) 95 | { 96 | unsigned char *gob_data; 97 | int i; 98 | 99 | (void) handle; 100 | 101 | gob_data = malloc(len); 102 | if (!gob_data) 103 | return 0; 104 | 105 | if (fread(gob_data, 1, len, handle) != len) { 106 | free(gob_data); 107 | return 0; 108 | } 109 | 110 | gob->num_images = (short) ((gob_data[0]) + (gob_data[1] << 8)); 111 | 112 | gob->width = malloc(gob->num_images * sizeof(int)); 113 | gob->height = malloc(gob->num_images * sizeof(int)); 114 | gob->hs_x = malloc(gob->num_images * sizeof(int)); 115 | gob->hs_y = malloc(gob->num_images * sizeof(int)); 116 | gob->data = malloc(gob->num_images * sizeof(void *)); 117 | gob->orig_data = malloc(gob->num_images * sizeof(void *)); 118 | for (i = 0; i < gob->num_images; i++) { 119 | int image_size; 120 | int offset; 121 | 122 | offset = (gob_data[i * 4 + 2]) + (gob_data[i * 4 + 3] << 8) + (gob_data[i * 4 + 4] << 16) + (gob_data[i * 4 + 5] << 24); 123 | 124 | gob->width[i] = (short) ((gob_data[offset]) + (gob_data[offset + 1] << 8)); 125 | offset += 2; 126 | gob->height[i] = (short) ((gob_data[offset]) + (gob_data[offset + 1] << 8)); 127 | offset += 2; 128 | gob->hs_x[i] = (short) ((gob_data[offset]) + (gob_data[offset + 1] << 8)); 129 | offset += 2; 130 | gob->hs_y[i] = (short) ((gob_data[offset]) + (gob_data[offset + 1] << 8)); 131 | offset += 2; 132 | 133 | image_size = gob->width[i] * gob->height[i]; 134 | gob->orig_data[i] = malloc(image_size); 135 | memcpy(gob->orig_data[i], &gob_data[offset], image_size); 136 | gob->data[i] = (unsigned short *) gob->orig_data[i]; 137 | } 138 | 139 | free(gob_data); 140 | return 0; 141 | } 142 | 143 | int write_gob(FILE *handle, gob_t *gob) 144 | { 145 | int i; 146 | int offset; 147 | 148 | fputc((gob->num_images >> 0) & 0xff, handle); 149 | fputc((gob->num_images >> 8) & 0xff, handle); 150 | 151 | offset = 2 + (gob->num_images * 4); 152 | 153 | for (i = 0; i < gob->num_images; i++) { 154 | fputc((offset >> 0) & 0xff, handle); 155 | fputc((offset >> 8) & 0xff, handle); 156 | fputc((offset >> 16) & 0xff, handle); 157 | fputc((offset >> 24) & 0xff, handle); 158 | 159 | offset += 8; 160 | offset += gob->width[i] * gob->height[i]; 161 | } 162 | for (i = 0; i < gob->num_images; i++) { 163 | fputc((gob->width[i] >> 0) & 0xff, handle); 164 | fputc((gob->width[i] >> 8) & 0xff, handle); 165 | 166 | fputc((gob->height[i] >> 0) & 0xff, handle); 167 | fputc((gob->height[i] >> 8) & 0xff, handle); 168 | 169 | fputc((gob->hs_x[i] >> 0) & 0xff, handle); 170 | fputc((gob->hs_x[i] >> 8) & 0xff, handle); 171 | 172 | fputc((gob->hs_y[i] >> 0) & 0xff, handle); 173 | fputc((gob->hs_y[i] >> 8) & 0xff, handle); 174 | 175 | fwrite(gob->data[i], 1, gob->width[i] * gob->height[i], handle); 176 | } 177 | return 0; 178 | } 179 | 180 | int main(int argc, char **argv) 181 | { 182 | int usage = 0; 183 | int unpack = 0; 184 | int code = 0; 185 | FILE *f; 186 | int len; 187 | gob_t gob = {0}; 188 | char *filename = NULL; 189 | int filename_offset = 1; 190 | char *output = NULL; 191 | 192 | if (argc < 2) 193 | usage = 1; 194 | 195 | if (argv[1][0] == '-') { 196 | if (argv[1][1] == 'u') { 197 | if (argc < 3) 198 | usage = 1; 199 | unpack = 1; 200 | } else if (argv[1][1] == 'o') { 201 | if (argc < 3) 202 | usage = 1; 203 | output = argv[2]; 204 | filename_offset = 3; 205 | } else { 206 | usage = 1; 207 | } 208 | } 209 | 210 | if (usage) { 211 | printf("Usage: gobpack [-o output_file] [-u] [palette.pcx]\n\t-u to unpack the gob\n\t-o - output\n"); 212 | return 1; 213 | } 214 | 215 | if (unpack) { 216 | int width, height; 217 | int x_count, y_count; 218 | int xi, yi; 219 | int i; 220 | unsigned char *data; 221 | unsigned char *dst; 222 | unsigned char palette[768]; 223 | unsigned char *pal = NULL; 224 | 225 | if (argc > 3) { 226 | f = fopen(argv[3], "rb"); 227 | if (f) { 228 | fseek(f, -769, SEEK_END); 229 | i = fgetc(f); 230 | if (i == 0x0c) { 231 | pal = palette; 232 | if (fread(pal, 1, 768, f) != 768) { 233 | printf("Failed to read the palette!\n"); 234 | fclose(f); 235 | return -1; 236 | } 237 | } 238 | fclose(f); 239 | } 240 | } 241 | 242 | filename = malloc(strlen(argv[2]) + 5); 243 | if (!filename) { 244 | printf("Not enough memory!\n"); 245 | return -1; 246 | } 247 | 248 | strcpy(filename, argv[2]); 249 | strcat(filename, ".gob"); 250 | f = fopen(filename, "rb"); 251 | if (!f) { 252 | printf("Couldn't open file %s\n", filename); 253 | code = -1; 254 | goto u_fail_gob; 255 | } 256 | fseek(f, 0, SEEK_END); 257 | len = ftell(f); 258 | fseek(f, 0, SEEK_SET); 259 | 260 | read_gob(f, &gob, len); 261 | 262 | fclose(f); 263 | 264 | width = 0; 265 | height = 0; 266 | for (i = 0; i < gob.num_images; i++) { 267 | if (gob.height[i] > height) 268 | height = gob.height[i]; 269 | if (gob.width[i] > width) 270 | width = gob.width[i]; 271 | } 272 | width += 2; 273 | height += 2; 274 | 275 | data = malloc(400 * 256); 276 | if (!data) { 277 | printf("Not enough memory!\n"); 278 | code = -1; 279 | goto fail_data; 280 | } 281 | memset(data, 0, 400 * 256); 282 | 283 | x_count = 400 / width; 284 | y_count = 256 / width; 285 | 286 | for (yi = 0; yi < y_count; yi++) { 287 | for (xi = 0; xi < x_count; xi++) { 288 | int x, y; 289 | unsigned char *src; 290 | 291 | i = yi * x_count + xi; 292 | if (i >= gob.num_images) 293 | continue; 294 | 295 | src = gob.data[i]; 296 | dst = &data[(yi * height) * 400 + (xi * width)]; 297 | for (y = 0; y < gob.height[i]; y++) { 298 | for (x = 0; x < gob.width[i]; x++) { 299 | dst[y * 400 + x] = src[y * gob.width[i] + x]; 300 | } 301 | } 302 | } 303 | } 304 | 305 | strcpy(filename, argv[2]); 306 | strcat(filename, ".pcx"); 307 | f = fopen(filename, "wb"); 308 | if (!f) { 309 | printf("Couldn't open file %s\n", filename); 310 | code = -1; 311 | goto u_fail_pcx; 312 | } 313 | 314 | write_pcx(f, data, 400, 256, pal); 315 | 316 | fclose(f); 317 | 318 | strcpy(filename, argv[2]); 319 | strcat(filename, ".txt"); 320 | f = fopen(filename, "w"); 321 | if (!f) { 322 | printf("Couldn't open file %s\n", filename); 323 | code = -1; 324 | goto u_fail_txt; 325 | } 326 | 327 | fprintf(f, "num_images: %i\n\n", gob.num_images); 328 | for (yi = 0; yi < y_count; yi++) { 329 | for (xi = 0; xi < x_count; xi++) { 330 | 331 | i = yi * x_count + xi; 332 | if (i >= gob.num_images) 333 | continue; 334 | 335 | fprintf(f, "image: %i\n", i + 1); 336 | fprintf(f, "x: %i\n", (xi * width)); 337 | fprintf(f, "y: %i\n", (yi * height)); 338 | fprintf(f, "width: %i\n", gob.width[i]); 339 | fprintf(f, "height: %i\n", gob.height[i]); 340 | fprintf(f, "hotspot_x: %i\n", gob.hs_x[i]); 341 | fprintf(f, "hotspot_y: %i\n", gob.hs_y[i]); 342 | fprintf(f, "\n"); 343 | } 344 | } 345 | 346 | fclose(f); 347 | 348 | u_fail_txt: 349 | u_fail_pcx: 350 | fail_data: 351 | u_fail_gob: 352 | free(filename); 353 | } else { 354 | unsigned char *data; 355 | int i = 0; 356 | int x_pos = 0, y_pos = 0; 357 | 358 | data = malloc(400 * 256); 359 | if (!data) { 360 | printf("Not enough memory!\n"); 361 | return -1; 362 | } 363 | 364 | filename = malloc(strlen(argv[filename_offset]) + 5); 365 | if (!filename) { 366 | printf("Not enough memory!\n"); 367 | code = -1; 368 | goto fail_filename; 369 | } 370 | 371 | strcpy(filename, argv[filename_offset]); 372 | strcat(filename, ".pcx"); 373 | f = fopen(filename, "rb"); 374 | if (!f) { 375 | printf("Couldn't open file %s\n", filename); 376 | code = -1; 377 | goto p_fail_pcx; 378 | } 379 | 380 | read_pcx(f, data, 400 * 256, NULL); 381 | 382 | fclose(f); 383 | 384 | strcpy(filename, argv[filename_offset]); 385 | strcat(filename, ".txt"); 386 | f = fopen(filename, "r"); 387 | if (!f) { 388 | printf("Couldn't open file %s\n", filename); 389 | code = -1; 390 | goto p_fail_txt; 391 | } 392 | 393 | gob.num_images = 0; 394 | 395 | while (!feof(f)) { 396 | char buffer[1024]; 397 | int value; 398 | int arguments; 399 | 400 | arguments = fscanf(f, "%11s %i\n", buffer, &value); 401 | if (arguments != 2) { 402 | printf("Parse error: arguments != 2\n"); 403 | code = -1; 404 | goto fail_parse; 405 | } 406 | 407 | if (strcmp(buffer, "num_images:") == 0) { 408 | if (gob.num_images != 0) { 409 | printf("Parse error in %s\n", filename); 410 | code = -1; 411 | goto fail_parse; 412 | } 413 | gob.num_images = value; 414 | gob.width = malloc(gob.num_images * sizeof(int)); 415 | gob.height = malloc(gob.num_images * sizeof(int)); 416 | gob.hs_x = malloc(gob.num_images * sizeof(int)); 417 | gob.hs_y = malloc(gob.num_images * sizeof(int)); 418 | gob.data = malloc(gob.num_images * sizeof(void *)); 419 | gob.orig_data = malloc(gob.num_images * sizeof(void *)); 420 | } else if (strcmp(buffer, "image:") == 0) { 421 | i = value - 1; 422 | } else if (strcmp(buffer, "x:") == 0) { 423 | x_pos = value; 424 | } else if (strcmp(buffer, "y:") == 0) { 425 | y_pos = value; 426 | } else if (strcmp(buffer, "width:") == 0) { 427 | gob.width[i] = value; 428 | } else if (strcmp(buffer, "height:") == 0) { 429 | gob.height[i] = value; 430 | } else if (strcmp(buffer, "hotspot_x:") == 0) { 431 | gob.hs_x[i] = value; 432 | } else if (strcmp(buffer, "hotspot_y:") == 0) { 433 | int x, y; 434 | unsigned char *dst; 435 | 436 | gob.hs_y[i] = value; 437 | gob.orig_data[i] = malloc(gob.width[i] * gob.height[i]); 438 | gob.data[i] = gob.orig_data[i]; 439 | dst = gob.data[i]; 440 | for (y = 0; y < gob.height[i]; y++) { 441 | for (x = 0; x < gob.width[i]; x++) { 442 | dst[y * gob.width[i] + x] = data[(y_pos + y) * 400 + (x_pos + x)]; 443 | } 444 | } 445 | } 446 | } 447 | 448 | fclose(f); 449 | 450 | char *filename_gob = output; 451 | if (!filename_gob) { 452 | filename_gob = filename; 453 | strcpy(filename, argv[filename_offset]); 454 | strcat(filename, ".gob"); 455 | } 456 | f = fopen(filename_gob, "wb"); 457 | if (!f) { 458 | printf("Couldn't open file %s\n", filename); 459 | code = -1; 460 | goto p_fail_gob; 461 | } 462 | 463 | write_gob(f, &gob); 464 | 465 | fclose(f); 466 | 467 | printf("%s build\n", filename); 468 | 469 | p_fail_gob: 470 | fail_parse: 471 | free(gob.width); 472 | free(gob.height); 473 | free(gob.hs_x); 474 | free(gob.hs_y); 475 | free(gob.data); 476 | for (i = 0; i < gob.num_images; i++) { 477 | free(gob.orig_data[i]); 478 | } 479 | free(gob.orig_data); 480 | p_fail_txt: 481 | p_fail_pcx: 482 | free(filename); 483 | fail_filename: 484 | free(data); 485 | } 486 | 487 | return code; 488 | } 489 | -------------------------------------------------------------------------------- /src/sdl/sound.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sound.c 3 | * Copyright (C) 1998 Brainchild Design - http://brainchilddesign.com/ 4 | * 5 | * Copyright (C) 2001 Chuck Mason 6 | * 7 | * Copyright (C) 2002 Florian Schulze 8 | * 9 | * This file is part of Jump 'n Bump. 10 | * 11 | * Jump 'n Bump is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * Jump 'n Bump is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 | */ 25 | 26 | #include "globals.h" 27 | #include 28 | #ifndef _WIN32 29 | #include 30 | #endif 31 | #include "SDL.h" 32 | 33 | #ifndef NO_SDL_MIXER 34 | #include "SDL_mixer.h" 35 | 36 | static Mix_Music *current_music = (Mix_Music *) NULL; 37 | #endif 38 | 39 | sfx_data sounds[NUM_SFX]; 40 | 41 | static int SAMPLECOUNT = 512; 42 | 43 | #define MAX_CHANNELS 32 44 | 45 | typedef struct { 46 | /* loop flag */ 47 | int loop; 48 | /* The channel step amount... */ 49 | unsigned int step; 50 | /* ... and a 0.16 bit remainder of last step. */ 51 | unsigned int stepremainder; 52 | unsigned int samplerate; 53 | /* The channel data pointers, start and end. */ 54 | signed short *data; 55 | signed short *startdata; 56 | signed short *enddata; 57 | /* Hardware left and right channel volume lookup. */ 58 | int leftvol; 59 | int rightvol; 60 | } channel_info_t; 61 | 62 | channel_info_t channelinfo[MAX_CHANNELS]; 63 | 64 | /* Sample rate in samples/second */ 65 | int audio_rate = 44100; 66 | int global_sfx_volume = 0; 67 | /* 68 | // This function loops all active (internal) sound 69 | // channels, retrieves a given number of samples 70 | // from the raw sound data, modifies it according 71 | // to the current (internal) channel parameters, 72 | // mixes the per channel samples into the given 73 | // mixing buffer, and clamping it to the allowed 74 | // range. 75 | // 76 | // This function currently supports only 16bit. 77 | */ 78 | 79 | static void stopchan(int i) 80 | { 81 | if (channelinfo[i].data) { 82 | memset(&channelinfo[i], 0, sizeof(channel_info_t)); 83 | } 84 | } 85 | 86 | /* 87 | // This function adds a sound to the 88 | // list of currently active sounds, 89 | // which is maintained as a given number 90 | // (eight, usually) of internal channels. 91 | // Returns a handle. 92 | */ 93 | int addsfx(signed short *data, int len, int loop, int samplerate, int channel) 94 | { 95 | stopchan(channel); 96 | 97 | /* We will handle the new SFX. */ 98 | /* Set pointer to raw data. */ 99 | channelinfo[channel].data = data; 100 | channelinfo[channel].startdata = data; 101 | 102 | /* Set pointer to end of raw data. */ 103 | channelinfo[channel].enddata = channelinfo[channel].data + len - 1; 104 | channelinfo[channel].samplerate = samplerate; 105 | 106 | channelinfo[channel].loop = loop; 107 | channelinfo[channel].stepremainder = 0; 108 | 109 | return channel; 110 | } 111 | 112 | static void updateSoundParams(int slot, int volume) 113 | { 114 | int rightvol; 115 | int leftvol; 116 | 117 | /* 118 | // Set stepping 119 | // MWM 2000-12-24: Calculates proportion of channel samplerate 120 | // to global samplerate for mixing purposes. 121 | // Patched to shift left *then* divide, to minimize roundoff errors 122 | // as well as to use SAMPLERATE as defined above, not to assume 11025 Hz 123 | */ 124 | channelinfo[slot].step = ((channelinfo[slot].samplerate << 16) / audio_rate); 125 | 126 | leftvol = volume; 127 | rightvol = volume; 128 | 129 | /* Sanity check, clamp volume. */ 130 | if (rightvol < 0) 131 | rightvol = 0; 132 | if (rightvol > 127) 133 | rightvol = 127; 134 | 135 | if (leftvol < 0) 136 | leftvol = 0; 137 | if (leftvol > 127) 138 | leftvol = 127; 139 | 140 | channelinfo[slot].leftvol = leftvol; 141 | channelinfo[slot].rightvol = rightvol; 142 | } 143 | 144 | void mix_sound(void *unused, Uint8 *stream, int len) 145 | { 146 | /* Mix current sound data. */ 147 | /* Data, from raw sound, for right and left. */ 148 | register int sample; 149 | register int dl; 150 | register int dr; 151 | 152 | /* Pointers in audio stream, left, right, end. */ 153 | signed short *leftout; 154 | signed short *rightout; 155 | signed short *leftend; 156 | /* Step in stream, left and right, thus two. */ 157 | int step; 158 | 159 | /* Mixing channel index. */ 160 | int chan; 161 | 162 | (void) unused; 163 | 164 | /* Left and right channel */ 165 | /* are in audio stream, alternating. */ 166 | leftout = (signed short *) stream; 167 | rightout = ((signed short *) stream) + 1; 168 | step = 2; 169 | 170 | /* Determine end, for left channel only */ 171 | /* (right channel is implicit). */ 172 | leftend = leftout + (len / 4) * step; 173 | 174 | /* Mix sounds into the mixing buffer. */ 175 | /* Loop over step*SAMPLECOUNT, */ 176 | /* that is 512 values for two channels. */ 177 | while (leftout != leftend) { 178 | /* Reset left/right value. */ 179 | dl = *leftout * 256; 180 | dr = *rightout * 256; 181 | 182 | /* Love thy L2 chache - made this a loop. */ 183 | /* Now more channels could be set at compile time */ 184 | /* as well. Thus loop those channels. */ 185 | for (chan = 0; chan < MAX_CHANNELS; chan++) { 186 | /* Check channel, if active. */ 187 | if (channelinfo[chan].data) { 188 | /* Get the raw data from the channel. */ 189 | /* no filtering */ 190 | /* sample = *channelinfo[chan].data; */ 191 | /* linear filtering */ 192 | sample = (int) (((int) channelinfo[chan].data[0] * (int) (0x10000 - channelinfo[chan].stepremainder)) + ((int) channelinfo[chan].data[1] * (int) (channelinfo[chan].stepremainder))) >> 16; 193 | 194 | /* Add left and right part */ 195 | /* for this channel (sound) */ 196 | /* to the current data. */ 197 | /* Adjust volume accordingly. */ 198 | dl += sample * (channelinfo[chan].leftvol * global_sfx_volume) / 128; 199 | dr += sample * (channelinfo[chan].rightvol * global_sfx_volume) / 128; 200 | /* Increment index ??? */ 201 | channelinfo[chan].stepremainder += channelinfo[chan].step; 202 | /* MSB is next sample??? */ 203 | channelinfo[chan].data += channelinfo[chan].stepremainder >> 16; 204 | /* Limit to LSB??? */ 205 | channelinfo[chan].stepremainder &= 0xffff; 206 | 207 | /* Check whether we are done. */ 208 | if (channelinfo[chan].data >= channelinfo[chan].enddata) { 209 | if (channelinfo[chan].loop) { 210 | channelinfo[chan].data = channelinfo[chan].startdata; 211 | } else { 212 | stopchan(chan); 213 | } 214 | } 215 | } 216 | } 217 | 218 | /* Clamp to range. Left hardware channel. */ 219 | /* Has been char instead of short. */ 220 | /* if (dl > 127) *leftout = 127; */ 221 | /* else if (dl < -128) *leftout = -128; */ 222 | /* else *leftout = dl; */ 223 | 224 | dl = dl / 256; 225 | dr = dr / 256; 226 | 227 | if (dl > SHRT_MAX) 228 | *leftout = SHRT_MAX; 229 | else if (dl < SHRT_MIN) 230 | *leftout = SHRT_MIN; 231 | else 232 | *leftout = (signed short) dl; 233 | 234 | /* Same for right hardware channel. */ 235 | if (dr > SHRT_MAX) 236 | *rightout = SHRT_MAX; 237 | else if (dr < SHRT_MIN) 238 | *rightout = SHRT_MIN; 239 | else 240 | *rightout = (signed short) dr; 241 | 242 | /* Increment current pointers in stream */ 243 | leftout += step; 244 | rightout += step; 245 | } 246 | } 247 | 248 | /* misc handling */ 249 | 250 | char dj_init(void) 251 | { 252 | Uint16 audio_format = MIX_DEFAULT_FORMAT; 253 | int audio_channels = 2; 254 | int audio_buffers = 4096; 255 | 256 | open_screen(); 257 | 258 | if (main_info.no_sound) 259 | return 0; 260 | 261 | audio_buffers = SAMPLECOUNT * audio_rate / 11025; 262 | 263 | memset(channelinfo, 0, sizeof(channelinfo)); 264 | memset(sounds, 0, sizeof(sounds)); 265 | 266 | #ifndef NO_SDL_MIXER 267 | if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) { 268 | fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); 269 | main_info.no_sound = 1; 270 | return 1; 271 | } 272 | 273 | Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); 274 | printf("Opened audio at %dHz %dbit %s, %d bytes audio buffer\n", audio_rate, (audio_format & 0xFF), (audio_channels > 1) ? "stereo" : "mono", audio_buffers); 275 | 276 | Mix_SetMusicCMD(getenv("MUSIC_CMD")); 277 | 278 | Mix_SetPostMix(mix_sound, NULL); 279 | #else 280 | main_info.no_sound = 1; 281 | return 1; 282 | #endif 283 | 284 | return 0; 285 | } 286 | 287 | void dj_deinit(void) 288 | { 289 | if (main_info.no_sound) 290 | return; 291 | 292 | #ifndef NO_SDL_MIXER 293 | Mix_HaltMusic(); 294 | if (current_music) 295 | Mix_FreeMusic(current_music); 296 | current_music = NULL; 297 | 298 | Mix_CloseAudio(); 299 | #endif 300 | 301 | close_screen(); 302 | 303 | SDL_Quit(); 304 | } 305 | 306 | void dj_start(void) 307 | { 308 | } 309 | 310 | void dj_stop(void) 311 | { 312 | } 313 | 314 | char dj_autodetect_sd(void) 315 | { 316 | return 0; 317 | } 318 | 319 | char dj_set_stereo(char flag) 320 | { 321 | (void) flag; 322 | return 0; 323 | } 324 | 325 | void dj_set_auto_mix(char flag) 326 | { 327 | (void) flag; 328 | } 329 | 330 | unsigned short dj_set_mixing_freq(unsigned short freq) 331 | { 332 | return freq; 333 | } 334 | 335 | void dj_set_dma_time(unsigned short time) 336 | { 337 | (void) time; 338 | } 339 | 340 | void dj_set_nosound(char flag) 341 | { 342 | (void) flag; 343 | } 344 | 345 | /* mix handling */ 346 | 347 | void dj_mix(void) 348 | { 349 | } 350 | 351 | /* sfx handling */ 352 | 353 | char dj_set_num_sfx_channels(char num_channels) 354 | { 355 | return num_channels; 356 | } 357 | 358 | void dj_set_sfx_volume(char volume) 359 | { 360 | if (main_info.no_sound) 361 | return; 362 | 363 | SDL_LockAudio(); 364 | global_sfx_volume = volume * 2; 365 | SDL_UnlockAudio(); 366 | } 367 | 368 | void dj_play_sfx(unsigned char sfx_num, unsigned short freq, char volume, char panning, unsigned short delay, signed char channel) 369 | { 370 | int slot; 371 | 372 | (void) panning; 373 | (void) delay; 374 | 375 | if (main_info.music_no_sound || main_info.no_sound) 376 | return; 377 | 378 | if (channel < 0) { 379 | for (slot = 0; slot < MAX_CHANNELS; slot++) 380 | if (channelinfo[slot].data == NULL) 381 | break; 382 | if (slot >= MAX_CHANNELS) 383 | return; 384 | } else 385 | slot = channel; 386 | 387 | SDL_LockAudio(); 388 | addsfx((short *) sounds[sfx_num].buf, sounds[sfx_num].length, sounds[sfx_num].loop, freq, slot); 389 | updateSoundParams(slot, volume * 2); 390 | SDL_UnlockAudio(); 391 | } 392 | 393 | char dj_get_sfx_settings(unsigned char sfx_num, sfx_data *data) 394 | { 395 | if (main_info.no_sound) 396 | return 0; 397 | 398 | memcpy(data, &sounds[sfx_num], sizeof(sfx_data)); 399 | return 0; 400 | } 401 | 402 | char dj_set_sfx_settings(unsigned char sfx_num, sfx_data *data) 403 | { 404 | if (main_info.no_sound) 405 | return 0; 406 | 407 | memcpy(&sounds[sfx_num], data, sizeof(sfx_data)); 408 | return 0; 409 | } 410 | 411 | void dj_set_sfx_channel_volume(char channel_num, char volume) 412 | { 413 | if (main_info.no_sound) 414 | return; 415 | 416 | SDL_LockAudio(); 417 | updateSoundParams(channel_num, volume * 2); 418 | SDL_UnlockAudio(); 419 | } 420 | 421 | void dj_stop_sfx_channel(char channel_num) 422 | { 423 | if (main_info.no_sound) 424 | return; 425 | 426 | SDL_LockAudio(); 427 | stopchan(channel_num); 428 | SDL_UnlockAudio(); 429 | } 430 | 431 | char dj_load_sfx(unsigned char *file_handle, char *filename, int file_length, char sfx_type, unsigned char sfx_num) 432 | { 433 | unsigned int i; 434 | unsigned char *src; 435 | unsigned short *dest; 436 | 437 | (void) filename; 438 | (void) sfx_type; 439 | 440 | if (main_info.no_sound) 441 | return 0; 442 | 443 | sounds[sfx_num].buf = malloc(file_length); 444 | 445 | memcpy(sounds[sfx_num].buf, file_handle, file_length); 446 | 447 | sounds[sfx_num].length = file_length / 2; 448 | src = sounds[sfx_num].buf; 449 | dest = (unsigned short *) sounds[sfx_num].buf; 450 | for (i = 0; i < sounds[sfx_num].length; i++) { 451 | unsigned short temp; 452 | temp = src[0] + (src[1] << 8); 453 | *dest = temp; 454 | src += 2; 455 | dest++; 456 | } 457 | return 0; 458 | } 459 | 460 | void dj_free_sfx(unsigned char sfx_num) 461 | { 462 | if (main_info.no_sound) 463 | return; 464 | 465 | free(sounds[sfx_num].buf); 466 | memset(&sounds[sfx_num], 0, sizeof(sfx_data)); 467 | } 468 | 469 | /* mod handling */ 470 | 471 | char dj_ready_mod(char mod_num) 472 | { 473 | #ifndef NO_SDL_MIXER 474 | FILE *tmp; 475 | int tmp_fd; 476 | char *filename; 477 | unsigned char *fp; 478 | int len; 479 | 480 | if (main_info.no_sound) 481 | return 0; 482 | 483 | switch (mod_num) { 484 | case MOD_MENU: 485 | fp = dat_open("jump.mod"); 486 | len = dat_filelen("jump.mod"); 487 | break; 488 | case MOD_GAME: 489 | fp = dat_open("bump.mod"); 490 | len = dat_filelen("bump.mod"); 491 | break; 492 | case MOD_SCORES: 493 | fp = dat_open("scores.mod"); 494 | len = dat_filelen("scores.mod"); 495 | break; 496 | default: 497 | fprintf(stderr, "bogus parameter to dj_ready_mod()\n"); 498 | fp = NULL; 499 | len = 0; 500 | break; 501 | } 502 | 503 | if (Mix_PlayingMusic()) 504 | Mix_FadeOutMusic(1500); 505 | 506 | if (current_music) { 507 | Mix_FreeMusic(current_music); 508 | current_music = NULL; 509 | } 510 | 511 | if (fp == NULL) { 512 | return 0; 513 | } 514 | 515 | #ifdef _MSC_VER 516 | // FIXME: Implement safe temporary files for MSVC (needs alternative for mkstemp) 517 | filename = strdup("jnb.tmpmusic.mod"); 518 | tmp = fopen(filename, "wb"); 519 | if (tmp) { 520 | fwrite(fp, len, 1, tmp); 521 | fflush(tmp); 522 | fclose(tmp); 523 | } 524 | #else 525 | #ifdef __MINGW32__ 526 | filename = strdup("jumpnbump.mod.XXXXXX"); 527 | #else // Unix 528 | filename = strdup("/tmp/jumpnbump.mod.XXXXXX"); 529 | #endif 530 | tmp_fd = mkstemp(filename); 531 | if (tmp_fd == -1) { 532 | free(filename); 533 | return 0; 534 | } 535 | tmp = fdopen(tmp_fd, "wb"); 536 | if (!tmp) { 537 | free(filename); 538 | return 0; 539 | } 540 | fwrite(fp, len, 1, tmp); 541 | fflush(tmp); 542 | fclose(tmp); 543 | #endif 544 | 545 | current_music = Mix_LoadMUS(filename); 546 | remove(filename); 547 | free(filename); 548 | if (current_music == NULL) { 549 | fprintf(stderr, "Couldn't load music: %s\n", SDL_GetError()); 550 | return 0; 551 | } 552 | 553 | #endif 554 | 555 | return 0; 556 | } 557 | 558 | char dj_start_mod(void) 559 | { 560 | #ifndef NO_SDL_MIXER 561 | if (main_info.no_sound) 562 | return 0; 563 | 564 | Mix_VolumeMusic(0); 565 | Mix_PlayMusic(current_music, -1); 566 | #endif 567 | 568 | return 0; 569 | } 570 | 571 | void dj_stop_mod(void) 572 | { 573 | #ifndef NO_SDL_MIXER 574 | if (main_info.no_sound) 575 | return; 576 | 577 | Mix_HaltMusic(); 578 | #endif 579 | } 580 | 581 | void dj_set_mod_volume(char volume) 582 | { 583 | #ifdef NO_SDL_MIXER 584 | (void) volume; 585 | #else 586 | if (main_info.no_sound) 587 | return; 588 | 589 | Mix_VolumeMusic(volume); 590 | #endif 591 | } 592 | 593 | char dj_load_mod(unsigned char *file_handle, char *filename, char mod_num) 594 | { 595 | (void) file_handle; 596 | (void) filename; 597 | (void) mod_num; 598 | return 0; 599 | } 600 | 601 | void dj_free_mod(char mod_num) 602 | { 603 | (void) mod_num; 604 | } 605 | -------------------------------------------------------------------------------- /src/sdl/jumpnbump128.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * jumpnbump_xpm[] = { 3 | "128 128 65 1", 4 | " c None", 5 | ". c #06070A", 6 | "+ c #B6B6B6", 7 | "@ c #F60202", 8 | "# c #727272", 9 | "$ c #B60202", 10 | "% c #5A5C5D", 11 | "& c #FC8622", 12 | "* c #3A1602", 13 | "= c #C6C6C6", 14 | "- c #A6221A", 15 | "; c #8E8E8E", 16 | "> c #D6D6D6", 17 | ", c #FB8E24", 18 | "' c #4A2A1A", 19 | ") c #E6E6E6", 20 | "! c #CE7222", 21 | "~ c #505252", 22 | "{ c #A15A1F", 23 | "] c #F79B37", 24 | "^ c #FEB666", 25 | "/ c #AE5A0A", 26 | "( c #D66C16", 27 | "_ c #DE6A18", 28 | ": c #EFEEEE", 29 | "< c #7A0202", 30 | "[ c #FEA640", 31 | "} c #664833", 32 | "| c #CCA085", 33 | "1 c #2A2A32", 34 | "2 c #895F38", 35 | "3 c #3C3A3F", 36 | "4 c #EAAE7C", 37 | "5 c #A8805B", 38 | "6 c #9E9E9E", 39 | "7 c #FEC68E", 40 | "8 c #BB5E0F", 41 | "9 c #EE3A3A", 42 | "0 c #AF5207", 43 | "a c #FEAE42", 44 | "b c #5A2A02", 45 | "c c #F8F6F9", 46 | "d c #636262", 47 | "e c #CB6312", 48 | "f c #E67215", 49 | "g c #8E4202", 50 | "h c #1D1C20", 51 | "i c #6A3202", 52 | "j c #7A685D", 53 | "k c #A4500C", 54 | "l c #F5781A", 55 | "m c #7A7A7A", 56 | "n c #F6CEA6", 57 | "o c #4A4242", 58 | "p c #FEDEBF", 59 | "q c #FDFEFD", 60 | "r c #D67A3A", 61 | "s c #FDA64D", 62 | "t c #7A3A02", 63 | "u c #B64242", 64 | "v c #FE7A12", 65 | "w c #6A6A6A", 66 | "x c #DE7A2A", 67 | "y c #150D0C", 68 | "z c #FEAE4C", 69 | " ", 70 | " ", 71 | " ", 72 | " ", 73 | " ", 74 | " ", 75 | " ", 76 | " ", 77 | " ", 78 | " ", 79 | " ", 80 | " ", 81 | " ", 82 | " ", 83 | " ", 84 | " ", 85 | " ", 86 | " ", 87 | " ", 88 | " ", 89 | " 6;;66 ", 90 | " 6;;66 ", 91 | " 6;;;## ", 92 | " mm 6;;;#### ", 93 | " ##m mm;#dwmm ", 94 | " ##m mm;mw#mm ", 95 | " %%%~ m;;;#~% ", 96 | " mm#=66 ~~~3 ;66#dmm ", 97 | " ;;m+6666 ~~~3 #6;;%w66 ", 98 | " ;;m+;666 + ~~~~3 #;;;%w66 ", 99 | " ;;m+66;6 + ~~~~3 #6;;~w66 ", 100 | " 666+++::66 66d6 ~%~~o m;6~%d6 ", 101 | " 6>;;==qq6 +##~; ~%~%3w #6m~~; ", 102 | " 6:++mm::6 +;ddw6 ~~dd1~ ;;m6#mm6 ", 103 | " 6)++mm::6 +;ddw6 ~~dd1~ ;;m6wmm6 ", 104 | " 6c::##==q6 ==;mddm+ ~%ww33 ;;;;;w666 ", 105 | " ;)qq++66q6 ++6mmm+= %%##%o mmm6;m66; ", 106 | " 6=qq))66:6 7744=+++666+ %%###m66 mm#6;;66 ", 107 | " 6=qq))66)6 7744=+++666+ %%###m66 mmm6m;66 ", 108 | " 6qqcc==)q66[]]]||===>=++= %om#m;;;;mmm6;;6; ", 109 | " 4;::qq))>q66z[4z==>)))===> 33wwmmmmd;;;6;;;; ", 110 | " 4;::qq))>q66a[44==>)))===> 3w#mmmmd;;;6;;;; ", 111 | " 4;::qq))>q66s[44==>)))===> 3wwmmmmd;;;6;;;; ", 112 | " za[[]5))cccc:cqq^[==>>)cc>=>>n^ 1%%mmmm#;;;m;m55 ", 113 | " xszz[[[[[[[aa[|++ccqqcqqqn4==))c))>>==^]77|.oo#mmm##mm;;m55r{}2 ", 114 | " e8zzaz[aa[s[sss[]jj==qqqqqqp=))::c)))>44s[[s,y11w###m;;;66666m1y.ii&&, ", 115 | " 8ezzaas[a[sa[^sz]#j==qqqqqqp=))::c)))>44ss[s,.11d###m;;;66666m1.yii&&& ", 116 | " 22]z[[z[[aas[^^77r|++ccqqqq:>))ccq::>=^4s[,,lb..ow##m;666;;666#yhxx&&&lvv, ", 117 | " /zzzzzz[[z^zsn:ppccqqqcqqq:ccqqc))=^ss]&!!!*hh~w##;66666hw#+633tt,&&&&&&&&,,, ", 118 | " txsszszsz^z77pcqqqqqqqqqqqqqqqqc))n]fffe88}}%ddw##;666661.y66mm''&&&&&&&&&&&&&&&] ", 119 | " ta[zzz^^^7ppcqqqqqqqqqqqqqqqqqcqq4r_((822~~~~%w##m;m;6+w..d+66~}ff&&v&v&&&v&&v&&vlv ", 120 | " t[[zza^^^7ppcqqqqqqqqcqqqqqqqqcqq4!((!822}~~~%d##m;;;6+w..%+66~}lf&&&&&v&&&&&&&&vvv ", 121 | " 'ee^aaazs^:cqqqqqqqqqqqqqqqqqqqqqc^!!e0}t11oo%d##m;;;;6611166;ddflv&&,&&&v&&&&,&vs] ", 122 | " '!!^zzzss^::qqqqqqqqqqqqqcqqqqqqqc^!!ekt}11oo%d##m;;;66611h6662j_l&&,,&&&&&&,,]&x ", 123 | " bb,zszzs^::qqqqqqqqqqqqqqqqqqcqqqn!!e{''yh33%dwwm;;;;;6%dh666jjxx&&,&&v&&&&&&&& ", 124 | " bb]zzzzz^::qqqqqqqqcqqqqqqqqqqqqqn!!ek''yy33%dwwm;m;;;6ddy666#jxxv&&,&&,,x&,&&& ", 125 | " gzzs^s=))qqcc::qqqqccqqqqqqqccqq]]e{**yy33~%dd#mmm;;;mm3;;;mmrr],&&&,]]&,&&] ", 126 | " *//lfr=::cq6666qqqqqqcqqqqqqqqqc44eg...h33o~%%wmm#m#;;;;;;;mm''g_&&,&&,vvss ", 127 | " ikkffx+>>))hh66qqq:;;=qqqqqcqqqq77!g.y.13oo~~%w####mm;;;m55uubb**bb{8eess ", 128 | " ik0ffr+>>))hy66qqq:;;=qqqqqcqqqq77!gy..1ooo~%%d####m#;;;;;5uubby*bbkeeess ", 129 | " g00_fllvvvvlvr++);..::qqq;..>qqqqqqqqqqnnx0*y.1333o%%%ddww##w#m#99@@tttibb*b00&x ", 130 | " kgkl&vvvvlvlvv&lvlrr|~yyccqqq~yhcqqqqqqqqqqnnx8**11*h13oo~%%%ddwwd%2--$$bbgkeef,]]]]zz ", 131 | " t8vvvvvvvvvvvvvv&l822ppccc.ddqqqqqqqqqc:44!eii*yyyh133o~~~%~~oo~o<>>|!feekg*.....y*t!x!l,]s[sz[[[[[[s][[][[[[[[[[]z ", 137 | " {{(vlvvvvll&vvvllvvlv&&^ccccc:>>>|r!eekk*.....*ytf!fl,][[[z[[[[[[[s[[[[[][[[[[]z ", 138 | " ikklf&v&lvvvlvvlvvlvvl,44===>>|!ee__ib..**gevv][sszz[zz[[[[s][[[[[[][[[[[[[[[, ", 139 | " ibi**/&&&vvvl&vllvvvvllvv&l4|4re_(e_gg{l]][saazss[a[z[[s[s]zs[]s[[[[[[[[][[[[[]] ", 140 | " iiiiiiiiiff&,&&lv&vlvllv&lll&l(_((fff&[[aszzasaas[aasa[sz[z[[[[s[[[[[[[[[[[[[[[[[[[ ", 141 | " iiiiiiiiiff&&&&vlvvvvv&v&lllll__f_ffl&[[asazzsaasaaasa[zz[z[[[[[[[]s[[][[[[[[[[[[[[ ", 142 | " iiiiiiiii**i8&&lv&&&&vlvf00ttbbb0e!fazssazzzs[ssaaa[sasaaszs][[azs[[[[s[[s][[[[[[[[ ", 143 | " iiiiiiiiibiiiii((vvfe{kbiiiiiibbkekk]zzzzzasaz[[z[[[a[[zs[[zzs[sz[as]z[[]zs[s[[[[[[[ ", 144 | " iiiiiiiiiiiiiiiiibb*iiiiiiiiiiii/_kk!zzzsszzzsaszzzz[z[aaaszs[[aaszss[sza[][[][][[], ", 145 | " iiiiiiiiiiiiiiiiibb*iiiiiiiiiiii8_kkezzzssazzszazszs[z[aaz[zz[[aasass[saa[s[[s[][[]] ", 146 | " iiiiiiiiiiiiiiiiibi*iiiiiiiiiiii/_kk!zzzzszzzzzzzazz]z[aaz[zzs]a[sas][saa[[[[[[]]] ", 147 | " iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiitt8f//0sszzzzzzszzzzzz[sassas[assaaz]zas[[ass][&! ", 148 | " iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiitte(eek!^^szzzsz[szazzzzs[[saaz[[zz[za]za[sx,!5d# ", 149 | " iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiitte(eek!^aaazzzzs]szzzzasaasazz[[zz[z[[sa[[,r58dw ", 150 | " iiib-iiiiiiiiiiiiiiiiiiiiiiiiiitt_fee/k]]szzzzzzzszzazzz[[asaas]aazz[[]r5m#www#wd ", 151 | " iiiiiibiiiiiiiiiiiiiiiiiiiiiiiigke__(/k//zszzzszzzss]szzssz[zszz[[,!88k2dd#mwww ", 152 | " iiiiiib-iiiiiiiiiiiiiiiiiiiiiiikg(e((8kkk!^szzzsszszzzazzszz[[xx08kk00kwm#ww ", 153 | " iiiiiiiibiiiiiiiiiiiiiiiiiiiiii0k_(((e0k0k]z^[zzzzzzzszszz,!/8k/k00000{w##ww ", 154 | " iiiiiiiiiiib-iiiib-iiib-iiiiiiik0_(((8000g]^^szazzszzzzzzz]!80kk000000{w##ww ", 155 | " iiiiiiiiiiiiibiiiiibiiiiibiiiii08(e((e0//k/[[zsszzzzz],r880k00000000002#m#wwmm ", 156 | " iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiie8(e((e0//0k88s^]]x8//k0k00000000000000######w#w ", 157 | " iiiiiiiiiiiiiiiiiiiiiiiiii-biii88(e((e///0k8ezz]]r08/00/000/000k000000j##m##www; ", 158 | " iiiiiib-iiiiiiiiiiiiiiiiiiiiiii8e_e((e0//0ge8sz]]x/8/0kkk0k0k0000k0000######w#w; ", 159 | " iiiiiibi-biiiiiiiiiiiiiiiiit!!(e((e/k/0/kk{e{0k000000000000k0000k{/w#w######w# ", 160 | " iiiiiiiiiiiib-iiiiiiiiiiiit8e(ee(e/k0/{k0kkkk/kkk00/0k000k/0000022#w#########ww ", 161 | " iiiiiiiiiibiiiiibiiiiikeeeeeee8//k/00/k//00000k0000k0000k0{2jj#############w ", 162 | " iiiiiiiiib-iiiiiiiiiiigeeeeeee8//k/00/k//00k00000000000000{2jj#w############ ", 163 | " iiiiiiiiiiibiiiiiiiiik__!eeee8kk//kk/0/0//kk00k0k/k00{{2jw#m######w#ww#wwwww ", 164 | " b-iiiiiiiii-iiiiiiii0e(eeeeeekk/k00/k0k0kkk000000{22jj##################ww# ", 165 | " iiiiiiiiibiiiiiiii/eeeeee8e00k/kk0k00k/k00/k{{jw##wwww############www;; ", 166 | " iiiiiiiiiiiiiiiiii8ee8ee(8e00//kk0kk0k00k000{{jw#mwwww##m#########w#w;; ", 167 | " iiiiiiiiiiiiiiii0eeee88ee000/kk/k0/k000k2jww#w##w#######ww#####w# ", 168 | " iiiiiiiiiiiiii!eee8!8(888kk/00000k2j2j##ww#www###www#w#mw#dw ", 169 | " iiiiiii-biiiieeee8eee888kk0k000/k2j2###ww#ww###wwwwww#m ", 170 | " iiiibiiiiiiii!eee8eeee88kk000k0k{222j##wwmwww##w#wwwwwm ", 171 | " iiiiiiibtte88!888/80000kk{222#www#ww##ww##wwdd#; ", 172 | " iiiibbgk88e88e880!e{jjjw#ww##wwwmwww#wdd## ", 173 | " tbbbkg!88/0//x wwww#www##mww##wdm ", 174 | " tbbkk088! wwww##wwww#dw;; ", 175 | " }bbk/088! wwww##w#ww#dw;; ", 176 | " 88 ww#wwddd# ", 177 | " www# ", 178 | " ", 179 | " ", 180 | " ", 181 | " ", 182 | " ", 183 | " ", 184 | " ", 185 | " ", 186 | " ", 187 | " ", 188 | " ", 189 | " ", 190 | " ", 191 | " ", 192 | " ", 193 | " ", 194 | " ", 195 | " ", 196 | " "}; 197 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | --------------------------------------------------------------------------------