Skip to content

Commit

Permalink
Prep for v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Dec 8, 2020
1 parent 8b07e98 commit 39da36f
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ check:
@echo "Checking for trailing whitespace"
@! grep -IUrn --color "[[:blank:]]$$" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
@echo "Checking for DOS line-endings"
@! grep -IUrn --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@! grep -IUrn --color "" --exclude="*.tmx" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@echo "Checking src/CHANGELOG.txt"
@cat src/CHANGELOG.txt | grep ^${LIBRARY_VERSION}
@echo "Checking src/ttblit/__init__.py"
Expand Down
87 changes: 75 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,88 @@
[![PyPi Package](https://img.shields.io/pypi/v/32blit.svg)](https://pypi.python.org/pypi/32blit)
[![Python Versions](https://img.shields.io/pypi/pyversions/32blit.svg)](https://pypi.python.org/pypi/32blit)

This tool is intended for use with the 32Blit console to prepare assets and upload games.
This toolset is intended for use with the 32Blit console to prepare assets and upload games.

# WORK IN PROGRESS
# Running

You should install from source using:
The 32Blit toolset contains subcommands for each tool, you can list them with:

```
git clone https://github.com/pimoroni/32blit-tools
cd src/
python3 setup.py develop
32blit --help
```

# Running
* image - Convert images/sprites for 32Blit
* font - Convert fonts for 32Blit
* map - Convert popular tilemap formats for 32Blit
* raw - Convert raw/binary or csv data for 32Blit
* pack - Pack a collection of assets for 32Blit
* cmake - Generate CMake configuration for the asset packer
* flash - Flash a binary or save games/files to 32Blit
* metadata - Tag a 32Blit .blit file with metadata
* relocs - Prepend relocations to a game binary
* version - Print the current 32blit version

To run a tool, append its name after the `32blit` command, eg:

```
32blit --help
32blit version
```

## Packing Image Assets
## Tools

### Metadata

Build metadata, and add it to a `.blit` file.

### Flash

Flash and manage games on your 32Blit over USB serial.

### Relocs

Collate a list of addresses that need patched to make a `.blit` file relocatable and position-independent.

### Cmake

Generate CMake files for metadata information and/or asset pipeline inputs/outputs.

## Assets

You will typically create assets using the "asset pipeline", configured using an `assets.yml` file which lists all the files you want to include, and how they should be named in code.

An `assets.yml` file might look like:

```yml
# Define an output target for the asset builder
# in this case we want a CSource (and implicitly also a header file)
# type auto-detection will notice the ".cpp" and act accordingly
assets.cpp:
prefix: asset_
# Include assets/sprites.png
# and place it in a variable named "asset_sprites"
# Since it ends in ".png" the builder will run "sprites_packed" to convert our source file
assets/sprites.png:
name: sprites
palette: assets/sprites.act
strict: true # Fail if a colour does not exist in the palette
transparent: 255,0,255

# Include assets/level.tmx
# and place it in a variable named "asset_level_N_tmx"
# Since it ends in ".tmx" the builder will run "map_tiled" to convert our source file
assets/level*.tmx:
```
### Fonts
Converts a ttf file or image file into a 32Blit font.
Supported formats:
* Image .png, .gif
* Font .ttf
### Images
All image assets are handled by Pillow so most image formats will work, be careful with lossy formats since they may add unwanted colours to your palette and leave you with oversized assets.
Expand All @@ -39,15 +102,15 @@ Options:
* `packed` - (Defaults to true) will pack the output asset into bits depending on the palette size. A 16-colour palette would use 4-bits-per-pixel.
* `strict` - Only allow colours that are present in the palette image/file

## Packing Map Assets
### Maps/Levels

Supported formats:

* Tiled .tmx - https://www.mapeditor.org/ (extremely alpha!)

## Packing Raw Assets
### Raw Binaries/Text Formats

Supported formats:

* CSV .csv
* Binary .bin, .raw
* Binary .bin, .raw
6 changes: 6 additions & 0 deletions src/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.2.0
-----

* New: Version tool: 32blit version
* Packer: Format support for wildcard asset names

0.1.4
-----

Expand Down
92 changes: 81 additions & 11 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,88 @@
[![PyPi Package](https://img.shields.io/pypi/v/32blit.svg)](https://pypi.python.org/pypi/32blit)
[![Python Versions](https://img.shields.io/pypi/pyversions/32blit.svg)](https://pypi.python.org/pypi/32blit)

This tool is intended for use with the 32Blit console to prepare assets and upload games.
This toolset is intended for use with the 32Blit console to prepare assets and upload games.

# WORK IN PROGRESS
# Running

You should install from source using:
The 32Blit toolset contains subcommands for each tool, you can list them with:

```
git clone https://github.com/pimoroni/32blit-tools
cd src/
python3 setup.py develop
32blit --help
```

# Running
* image - Convert images/sprites for 32Blit
* font - Convert fonts for 32Blit
* map - Convert popular tilemap formats for 32Blit
* raw - Convert raw/binary or csv data for 32Blit
* pack - Pack a collection of assets for 32Blit
* cmake - Generate CMake configuration for the asset packer
* flash - Flash a binary or save games/files to 32Blit
* metadata - Tag a 32Blit .blit file with metadata
* relocs - Prepend relocations to a game binary
* version - Print the current 32blit version

To run a tool, append its name after the `32blit` command, eg:

```
32blit --help
32blit version
```

## Packing Image Assets
## Tools

### Metadata

Build metadata, and add it to a `.blit` file.

### Flash

Flash and manage games on your 32Blit over USB serial.

### Relocs

Collate a list of addresses that need patched to make a `.blit` file relocatable and position-independent.

### Cmake

Generate CMake files for metadata information and/or asset pipeline inputs/outputs.

## Assets

You will typically create assets using the "asset pipeline", configured using an `assets.yml` file which lists all the files you want to include, and how they should be named in code.

An `assets.yml` file might look like:

```yml
# Define an output target for the asset builder
# in this case we want a CSource (and implicitly also a header file)
# type auto-detection will notice the ".cpp" and act accordingly
assets.cpp:
prefix: asset_
# Include assets/sprites.png
# and place it in a variable named "asset_sprites"
# Since it ends in ".png" the builder will run "sprites_packed" to convert our source file
assets/sprites.png:
name: sprites
palette: assets/sprites.act
strict: true # Fail if a colour does not exist in the palette
transparent: 255,0,255

# Include assets/level.tmx
# and place it in a variable named "asset_level_N_tmx"
# Since it ends in ".tmx" the builder will run "map_tiled" to convert our source file
assets/level*.tmx:
```
### Fonts
Converts a ttf file or image file into a 32Blit font.
Supported formats:
* Image .png, .gif
* Font .ttf
### Images
All image assets are handled by Pillow so most image formats will work, be careful with lossy formats since they may add unwanted colours to your palette and leave you with oversized assets.
Expand All @@ -39,21 +102,28 @@ Options:
* `packed` - (Defaults to true) will pack the output asset into bits depending on the palette size. A 16-colour palette would use 4-bits-per-pixel.
* `strict` - Only allow colours that are present in the palette image/file

## Packing Map Assets
### Maps/Levels

Supported formats:

* Tiled .tmx - https://www.mapeditor.org/ (extremely alpha!)

## Packing Raw Assets
### Raw Binaries/Text Formats

Supported formats:

* CSV .csv
* Binary .bin, .raw


# Changelog

0.2.0
-----

* New: Version tool: 32blit version
* Packer: Format support for wildcard asset names

0.1.4
-----

Expand Down
2 changes: 1 addition & 1 deletion src/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
[metadata]
name = 32blit
version = 0.1.4
version = 0.2.0
author = Philip Howard
author_email = [email protected]
description = 32Blit asset preparation and upload tools
Expand Down
2 changes: 1 addition & 1 deletion src/ttblit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

__version__ = '0.1.4'
__version__ = '0.2.0'

import argparse
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/ttblit/tool/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class Metadata(Tool):
command = 'metadata'
help = 'Tag a 32Blit .bin file with metadata'
help = 'Tag a 32Blit .blit file with metadata'

def __init__(self, parser):
Tool.__init__(self, parser)
Expand Down

0 comments on commit 39da36f

Please sign in to comment.