mirror of
https://github.com/cxong/cdogs-sdl.git
synced 2025-07-23 07:23:01 +02:00
Fix style warnings
This commit is contained in:
18
README.md
18
README.md
@@ -1,12 +1,12 @@
|
||||

|
||||
==========
|
||||
# 
|
||||
|
||||
[](https://app.codacy.com/manual/cxong/cdogs-sdl?utm_source=github.com&utm_medium=referral&utm_content=cxong/cdogs-sdl&utm_campaign=Badge_Grade_Dashboard)
|
||||
[](https://travis-ci.org/cxong/cdogs-sdl)
|
||||
[](https://ci.appveyor.com/project/cxong/cdogs-sdl)
|
||||
[](https://github.com/cxong/cdogs-sdl/releases)
|
||||
[](https://github.com/cxong/cdogs-sdl/releases/latest)
|
||||
|
||||
##  Introduction ##
|
||||
##  Introduction
|
||||
|
||||
C-Dogs SDL is a classic overhead run-and-gun game, supporting up to 4 players
|
||||
in co-op and deathmatch modes. Customize your player, choose from many weapons,
|
||||
@@ -17,7 +17,7 @@ Have fun!
|
||||
|
||||
For more information about the original C-Dogs read [`original\_readme.txt`](https://raw.githubusercontent.com/cxong/cdogs-sdl/master/doc/original_readme.txt).
|
||||
|
||||
##  What is C-Dogs SDL? ##
|
||||
##  What is C-Dogs SDL
|
||||
|
||||

|
||||
|
||||
@@ -34,7 +34,7 @@ These days the project is maintained by Cong Xu, who along with a few other cont
|
||||
So what are you waiting for? Download C-Dogs SDL today and have a blast!
|
||||
|
||||
|
||||
##  Platforms ##
|
||||
##  Platforms
|
||||
|
||||
<a href="https://repology.org/metapackage/cdogs-sdl/versions">
|
||||
<img src="https://repology.org/badge/vertical-allrepos/cdogs-sdl.svg" alt="Packaging status" align="right">
|
||||
@@ -45,13 +45,13 @@ See the SDL website - <http://www.libsdl.org> for more about SDL itself.
|
||||
|
||||
C-Dogs SDL runs on Linux, \*BSD, Windows, Mac OS X, Pandora and GCW-Zero. There are a few other unsupported and outdated ports too.
|
||||
|
||||
##  Installation ##
|
||||
##  Installation
|
||||
|
||||
Please use the installers for your platform for installing.
|
||||
|
||||
Follow the [getting started wiki](https://github.com/cxong/cdogs-sdl/wiki#getting-started) to build on your platform. You will need the SDL2 development libraries installed.
|
||||
|
||||
##  License ##
|
||||
##  License
|
||||
|
||||
tl;dr: **GPLv2** for code, **CC0/CC-BY/CC-BY-SA** for assets. Significant amounts of **BSD 2-clause** code.
|
||||
|
||||
@@ -59,9 +59,9 @@ Code is licensed under GPL version 2, with significant portions under BSD 2-clau
|
||||
|
||||
Data is licensed under various free terms, including CC0, CC-BY and CC-BY-SA. [The original C-Dogs data is also under CC-BY](https://raw.githubusercontent.com/cxong/cdogs-sdl/master/doc/README_DATA.md). New data is licensed as CC0 if not specified. You are free to use, modify and redistribute these for any purpose, as long as you follow their licenses.
|
||||
|
||||
##  Contact ##
|
||||
##  Contact
|
||||
|
||||
If you have any questions, comments, bug reports, patches or anything else related to C-Dogs SDL:
|
||||
|
||||
- [Raise an issue](https://github.com/cxong/cdogs-sdl/issues)
|
||||
- Email: Cong <congusbongus@gmail.com>
|
||||
- Email: Cong <mailto:congusbongus@gmail.com>
|
||||
|
@@ -1 +1 @@
|
||||
**bullets.json** and **guns.json**: definitions for bullets and guns used in game. See https://github.com/cxong/cdogs-sdl/wiki/Custom-Weapons
|
||||
**bullets.json** and **guns.json**: definitions for bullets and guns used in game. See <https://github.com/cxong/cdogs-sdl/wiki/Custom-Weapons>
|
||||
|
@@ -10,10 +10,10 @@ This is a simple guide to making sprites that will fit in the style of C-Dogs. C
|
||||
|
||||
C-Dogs sprites are:
|
||||
|
||||
- Pixel art
|
||||
- Somewhat limited palette
|
||||
- Lit from the top-left, with a secondary light from the bottom-left
|
||||
- Some objects, like pickups, cast a 1px full black shadow along its bottom-right
|
||||
- Pixel art
|
||||
- Somewhat limited palette
|
||||
- Lit from the top-left, with a secondary light from the bottom-left
|
||||
- Some objects, like pickups, cast a 1px full black shadow along its bottom-right
|
||||
|
||||
### Colours
|
||||
|
||||
@@ -22,17 +22,17 @@ Try to use the limited palette that original C-Dogs uses. Not all current sprite
|
||||

|
||||
|
||||
If you use GIMP, you can also import this palette using
|
||||
- Windows > Palettes
|
||||
- Right click the list > Import Palette... > find palette.png
|
||||
- Open an image you want to palettise
|
||||
- Image > Mode > Indexed... > Use custom palette > select the imported C-Dogs palette
|
||||
- Windows > Palettes
|
||||
- Right click the list > Import Palette... > find palette.png
|
||||
- Open an image you want to palettise
|
||||
- Image > Mode > Indexed... > Use custom palette > select the imported C-Dogs palette
|
||||
|
||||
### Lighting
|
||||
|
||||
The primary light is from the top-left. This means that:
|
||||
|
||||
- Top and left edges are brightest
|
||||
- The top surface is brighter than the front surface
|
||||
- Top and left edges are brightest
|
||||
- The top surface is brighter than the front surface
|
||||
|
||||
Take these examples:
|
||||
|
||||
|
@@ -1,13 +1,14 @@
|
||||
- Rows are:
|
||||
- Groups of 5 rows: unarmed/armed
|
||||
- First row of group: idle
|
||||
- Next 4 rows of group: walking
|
||||
- Columns are directions
|
||||
- Colors are:
|
||||
- Red (0 hue): skin
|
||||
- Green (120 hue): hair
|
||||
- Blue (240 hue): arms
|
||||
- Yellow (60 hue): body
|
||||
- Cyan (180 hue): legs
|
||||
- Magenta (300 hue): feet
|
||||
- Any other shade: as is (recommend R, G, and B between 5 and 250)
|
||||
- Rows are:
|
||||
- Groups of 5 rows: unarmed/armed
|
||||
- First row of group: idle
|
||||
- Next 4 rows of group: walking
|
||||
|
||||
- Columns are directions
|
||||
- Colors are:
|
||||
- Red (0 hue): skin
|
||||
- Green (120 hue): hair
|
||||
- Blue (240 hue): arms
|
||||
- Yellow (60 hue): body
|
||||
- Cyan (180 hue): legs
|
||||
- Magenta (300 hue): feet
|
||||
- Any other shade: as is (recommend R, G, and B between 5 and 250)
|
@@ -49,15 +49,15 @@ do
|
||||
then
|
||||
collections=$collections,hand_right
|
||||
fi
|
||||
$BLENDER -b $INFILE -P render.py -- $collections $action $frames $part
|
||||
"$BLENDER" -b "$INFILE" -P render.py -- "$collections" "$action" "$frames" "$part"
|
||||
|
||||
DIMENSIONS=`identify -format "%wx%h" out/${part}_${action}_0_00.png`
|
||||
DIMENSIONS=`identify -format "%wx%h" "out/${part}_${action}_0_00.png"`
|
||||
OUTFILE=$1/${part}_${action}_${DIMENSIONS}.png
|
||||
rm $OUTFILE
|
||||
montage -geometry +0+0 -background none -tile x8 out/${part}_${action}_*.png -channel A tmpimage
|
||||
convert tmpimage -dither None -colors 32 -level 25%,60% $OUTFILE
|
||||
rm "$OUTFILE"
|
||||
montage -geometry +0+0 -background none -tile x8 "out/${part}_${action}_*.png" -channel A tmpimage
|
||||
convert tmpimage -dither None -colors 32 -level 25%,60% "$OUTFILE"
|
||||
rm tmpimage
|
||||
chmod 644 $OUTFILE
|
||||
chmod 644 "$OUTFILE"
|
||||
echo "Created $OUTFILE"
|
||||
done
|
||||
done
|
||||
|
@@ -1,10 +1,10 @@
|
||||
- Rows are:
|
||||
- First row: normal
|
||||
- Second row: when shooting
|
||||
- Colors are:
|
||||
- Red (0 hue): skin
|
||||
- Green (120 hue): hair
|
||||
- Any other shade: as is (recommend R, G, and B between 5 and 250)
|
||||
- Head will be rendered centered, but the base of the head when looking up
|
||||
should appear 3 pixels below the center
|
||||
- Note: head height must be even otherwise they will be offset by 1px (this is a bug)
|
||||
- Rows are:
|
||||
- First row: normal
|
||||
- Second row: when shooting
|
||||
- Colors are:
|
||||
- Red (0 hue): skin
|
||||
- Green (120 hue): hair
|
||||
- Any other shade: as is (recommend R, G, and B between 5 and 250)
|
||||
- Head will be rendered centered, but the base of the head when looking up
|
||||
should appear 3 pixels below the center
|
||||
- Note: head height must be even otherwise they will be offset by 1px (this is a bug)
|
||||
|
@@ -29,27 +29,27 @@ do
|
||||
frames=$idle_frames
|
||||
fi
|
||||
layers=$i
|
||||
$BLENDER -b $INFILE -P render.py -- $layers $action $frames $part
|
||||
"$BLENDER" -b "$INFILE" -P render.py -- "$layers" "$action" "$frames" "$part"
|
||||
for (( j=0; j<8; j++ ))
|
||||
do
|
||||
# Face not looking down needs to be shifted down a pixel
|
||||
if [ $j -ge 3 -a $j -le 5 ]
|
||||
if [ "$j" -ge 3 -a "$j" -le 5 ]
|
||||
then
|
||||
:
|
||||
else
|
||||
convert out/${part}_${action}_${j}_00.png -page +0+1 -background none -flatten tmpimage
|
||||
mv tmpimage out/${part}_${action}_${j}_00.png
|
||||
convert "out/${part}_${action}_${j}_00.png" -page +0+1 -background none -flatten tmpimage
|
||||
mv tmpimage "out/${part}_${action}_${j}_00.png"
|
||||
fi
|
||||
done
|
||||
|
||||
DIMENSIONS=`identify -format "%wx%h" out/${part}_${action}_0_00.png`
|
||||
DIMENSIONS=`identify -format "%wx%h" "out/${part}_${action}_0_00.png"`
|
||||
done
|
||||
OUTFILE=$1_${DIMENSIONS}.png
|
||||
rm $OUTFILE
|
||||
montage -geometry +0+0 -background none -tile 8x out/${part}_idle_*.png out/${part}_firing_*.png -channel A tmpimage
|
||||
convert tmpimage -dither None -colors 32 -level 25%,60% $OUTFILE
|
||||
rm "$OUTFILE"
|
||||
montage -geometry +0+0 -background none -tile 8x "out/${part}_idle_*.png" "out/${part}_firing_*.png" -channel A tmpimage
|
||||
convert tmpimage -dither None -colors 32 -level 25%,60% "$OUTFILE"
|
||||
rm tmpimage
|
||||
chmod 644 $OUTFILE
|
||||
chmod 644 "$OUTFILE"
|
||||
echo "Created $OUTFILE"
|
||||
done
|
||||
|
||||
|
@@ -11,8 +11,11 @@ Door sprites are generated via imagemagick by compositing several base sprites.
|
||||
### Door sprites
|
||||
|
||||
-  normal_h =  open_h +  h +  left +  right
|
||||
|
||||
-  normal_left + normal_hmid normal_right
|
||||
|
||||
-  normal_v =  v +  top +  bottom
|
||||
|
||||
-  normal_top
|
||||
 normal_vmid
|
||||
 normal_bottom
|
||||
@@ -22,8 +25,11 @@ Door sprites are generated via imagemagick by compositing several base sprites.
|
||||
Colors:  yellow  green  blue  red
|
||||
|
||||
-  key_h =  normal_h +  key_h +  key_left +  key_right
|
||||
|
||||
-    key_left + key_hmid + key_right
|
||||
|
||||
-  key_v =  normal_v +  key_v +  key_top +  key_bottom
|
||||
|
||||
-  key_top
|
||||
 key_vmid
|
||||
 key_bottom
|
||||
|
@@ -16,69 +16,69 @@ done
|
||||
|
||||
# Generate door bases
|
||||
# normal_h = open_h + h + left + right
|
||||
convert $1/base/open_h.png -background none -gravity South -extent 16x21 \
|
||||
$1/base/h.png -geometry +0+0 -composite \
|
||||
$1/base/left.png -geometry +0+0 -composite \
|
||||
$1/base/right.png -geometry +0+0 -composite \
|
||||
$1/normal_h.png
|
||||
convert $1/base/open_h.png -background none -gravity South -extent 16x21 \
|
||||
$1/base/h.png -geometry +0+0 -composite \
|
||||
$1/base/left.png -geometry +0+0 -composite \
|
||||
$1/normal_left.png
|
||||
convert $1/base/open_h.png -background none -gravity South -extent 16x21 \
|
||||
$1/base/h.png -geometry +0+0 -composite \
|
||||
$1/normal_hmid.png
|
||||
convert $1/base/open_h.png -background none -gravity South -extent 16x21 \
|
||||
$1/base/h.png -geometry +0+0 -composite \
|
||||
$1/base/right.png -geometry +0+0 -composite \
|
||||
$1/normal_right.png
|
||||
convert "$1/base/open_h.png" -background none -gravity South -extent 16x21 \
|
||||
"$1/base/h.png" -geometry +0+0 -composite \
|
||||
"$1/base/left.png" -geometry +0+0 -composite \
|
||||
"$1/base/right.png" -geometry +0+0 -composite \
|
||||
"$1/normal_h.png"
|
||||
convert "$1/base/open_h.png" -background none -gravity South -extent 16x21 \
|
||||
"$1/base/h.png" -geometry +0+0 -composite \
|
||||
"$1/base/left.png" -geometry +0+0 -composite \
|
||||
"$1/normal_left.png"
|
||||
convert "$1/base/open_h.png" -background none -gravity South -extent 16x21 \
|
||||
"$1/base/h.png" -geometry +0+0 -composite \
|
||||
"$1/normal_hmid.png"
|
||||
convert "$1/base/open_h.png" -background none -gravity South -extent 16x21 \
|
||||
"$1/base/h.png" -geometry +0+0 -composite \
|
||||
"$1/base/right.png" -geometry +0+0 -composite \
|
||||
"$1/normal_right.png"
|
||||
# normal_v = v + top + bottom
|
||||
convert $1/base/v.png \
|
||||
$1/base/top.png -geometry +0+0 -composite \
|
||||
$1/base/bottom.png -geometry +0+0 -composite \
|
||||
$1/normal_v.png
|
||||
convert $1/base/v.png \
|
||||
$1/base/top.png -geometry +0+0 -composite \
|
||||
$1/normal_top.png
|
||||
cp $1/base/v.png $1/normal_vmid.png
|
||||
convert $1/base/v.png \
|
||||
$1/base/bottom.png -geometry +0+0 -composite \
|
||||
$1/normal_bottom.png
|
||||
convert "$1/base/v.png" \
|
||||
"$1/base/top.png" -geometry +0+0 -composite \
|
||||
"$1/base/bottom.png" -geometry +0+0 -composite \
|
||||
"$1/normal_v.png"
|
||||
convert "$1/base/v.png" \
|
||||
"$1/base/top.png" -geometry +0+0 -composite \
|
||||
"$1/normal_top.png"
|
||||
cp "$1/base/v.png" "$1/normal_vmid.png"
|
||||
convert "$1/base/v.png" \
|
||||
"$1/base/bottom.png" -geometry +0+0 -composite \
|
||||
"$1/normal_bottom.png"
|
||||
|
||||
# Generate keys
|
||||
for key in blue green red yellow; do
|
||||
# key_h = normal_h + key_h + key_left + key_right
|
||||
convert $1/normal_h.png \
|
||||
$1/base/key/${key}_h.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_left.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_right.png -geometry +0+0 -composite \
|
||||
$1/${key}_h.png
|
||||
convert $1/normal_left.png \
|
||||
$1/base/key/${key}_h.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_left.png -geometry +0+0 -composite \
|
||||
$1/${key}_left.png
|
||||
convert $1/normal_hmid.png \
|
||||
$1/base/key/${key}_h.png -geometry +0+0 -composite \
|
||||
$1/${key}_hmid.png
|
||||
convert $1/normal_right.png \
|
||||
$1/base/key/${key}_h.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_right.png -geometry +0+0 -composite \
|
||||
$1/${key}_right.png
|
||||
convert "$1/normal_h.png" \
|
||||
"$1/base/key/${key}_h.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_left.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_right.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_h.png"
|
||||
convert "$1/normal_left.png" \
|
||||
"$1/base/key/${key}_h.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_left.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_left.png"
|
||||
convert "$1/normal_hmid.png" \
|
||||
"$1/base/key/${key}_h.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_hmid.png"
|
||||
convert "$1/normal_right.png" \
|
||||
"$1/base/key/${key}_h.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_right.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_right.png"
|
||||
# key_v = normal_v + key_v + key_top + key_bottom
|
||||
convert $1/normal_v.png \
|
||||
$1/base/key/${key}_v.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_top.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_bottom.png -geometry +0+0 -composite \
|
||||
$1/${key}_v.png
|
||||
convert $1/normal_top.png \
|
||||
$1/base/key/${key}_v.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_top.png -geometry +0+0 -composite \
|
||||
$1/${key}_top.png
|
||||
convert $1/normal_vmid.png \
|
||||
$1/base/key/${key}_v.png -geometry +0+0 -composite \
|
||||
$1/${key}_vmid.png
|
||||
convert $1/normal_bottom.png \
|
||||
$1/base/key/${key}_v.png -geometry +0+0 -composite \
|
||||
$1/base/key/${key}_bottom.png -geometry +0+0 -composite \
|
||||
$1/${key}_bottom.png
|
||||
convert "$1/normal_v.png" \
|
||||
"$1/base/key/${key}_v.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_top.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_bottom.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_v.png"
|
||||
convert "$1/normal_top.png" \
|
||||
"$1/base/key/${key}_v.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_top.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_top.png"
|
||||
convert "$1/normal_vmid.png" \
|
||||
"$1/base/key/${key}_v.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_vmid.png"
|
||||
convert "$1/normal_bottom.png" \
|
||||
"$1/base/key/${key}_v.png" -geometry +0+0 -composite \
|
||||
"$1/base/key/${key}_bottom.png" -geometry +0+0 -composite \
|
||||
"$1/${key}_bottom.png"
|
||||
done
|
||||
|
@@ -8,12 +8,12 @@ if [ "$#" -ne 1 ]; then
|
||||
fi
|
||||
command='convert $1 -background none -virtual-pixel background'
|
||||
|
||||
for i in `seq 45 45 315`; do
|
||||
for i in $(seq 45 45 315); do
|
||||
command="$command \\( -clone 0 -filter Point -distort SRT $i \\)"
|
||||
done
|
||||
|
||||
BASENAME=`basename "$1" | cut -d. -f1`
|
||||
DIMENSIONS=`identify -format "%wx%h" $1`
|
||||
BASENAME=$(basename "$1" | cut -d. -f1)
|
||||
DIMENSIONS=$(identify -format "%wx%h" $1)
|
||||
OUTFILE=${BASENAME}_${DIMENSIONS}.png
|
||||
|
||||
command="$command +append -alpha on $OUTFILE"
|
||||
|
@@ -4,5 +4,5 @@
|
||||
# TODO: force RGB, don't use grayscale
|
||||
#
|
||||
for image in *.png; do
|
||||
convert $image +depth +dither -remap palette.png ${image}
|
||||
convert "$image" +depth +dither -remap palette.png "$image"
|
||||
done
|
||||
|
@@ -15,11 +15,11 @@ if [ "$#" -eq 3 ]; then
|
||||
fi
|
||||
FILENAME_PREFIX=${1%%0.*}
|
||||
EXTENSION=${1##*.}
|
||||
for i in $(seq 1 $2)
|
||||
for i in $(seq 1 "$2")
|
||||
do
|
||||
FILENAME="${FILENAME_PREFIX}$((($i - 1) * 2 + 1)).${EXTENSION}"
|
||||
SHIFT=$(($SHIFT_RANGE * $i / $2))
|
||||
sox -G $1 $FILENAME pitch $SHIFT
|
||||
FILENAME="${FILENAME_PREFIX}$(($i * 2)).${EXTENSION}"
|
||||
sox -G $1 $FILENAME pitch -$SHIFT
|
||||
FILENAME="${FILENAME_PREFIX}$(((i - 1) * 2 + 1)).${EXTENSION}"
|
||||
SHIFT=$((SHIFT_RANGE * i / $2))
|
||||
sox -G "$1" "$FILENAME" pitch "$SHIFT"
|
||||
FILENAME="${FILENAME_PREFIX}$((i * 2)).${EXTENSION}"
|
||||
sox -G "$1" "$FILENAME" pitch "-$SHIFT"
|
||||
done
|
||||
|
Reference in New Issue
Block a user