From 087e45d9bae8ffaef840e907c38e4a8402fab69b Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 20 Jan 2014 13:53:17 -0500 Subject: Stuff. --- Makefile | 23 +++++++++++++++-------- README | 12 +++++++++++- nginx.inc.conf | 12 +++++++----- www/warn.html | 15 +++++++++------ www/warned.html | 10 ++++++++++ 5 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 www/warned.html diff --git a/Makefile b/Makefile index 5725e9d..3e3506b 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ -null := -SPACE := $(null) $(null) +null := +SPACE := $(null) $(null) FFMPEG ?= ffmpeg -FFMPEG += -v warning $(FFMPEGFLAGS) +FFMPEG += -v warning -y OPUSENC ?= opusenc ZOPFLIPNG ?= zopflipng -OPTIPNG ?= optipng -JPEGOPTIM ?= jpegoptim +TRUEPNG ?= wine TruePNG +DEFLOPT ?= wine DeflOpt +DEFLUFF ?= defluff +PNGQUANT ?= pngquant CWEBP ?= cwebp CWEBP += -short -alpha_cleanup WEBPMUX ?= webpmux @@ -35,7 +37,7 @@ video: $(CVIDEO) $(FFMPEG) -i $< -c:v libvpx -crf 15 -b:v 1M -c:a copy $@ %.ogv: %.mkv - $(FFMPEG) -i $< -c:v libtheora -qscale:v 6 -c:a copy $@ + $(FFMPEG) -i $< -c:v libtheora -qscale:v 10 -c:a copy $@ # === AUDIO === @@ -69,11 +71,15 @@ CTC_ANIM := $(DUMP)/ui/ctc_anim.png $(DUMP)/ui/ctc_anim.webp images: $(WEBP) $(CTC_ANIM) www/favicon.ico %.webp: %.png + $(PNGQUANT) --force --speed 1 --ext .png $< $(ZOPFLIPNG) -m -y $< $< + $(DEFLOPT) $< + $(DEFLUFF) < $< > TMP$< + mv TMP$< $< $(CWEBP) -q 99 -m 6 $< -o $@ %.webp: %.jpg - $(JPEGOPTIM) --strip-all $< + $(JPEGMINI) $< $(CWEBP) -q 90 -m 6 $< -o $@ www/favicon.ico: $(DUMP)/ui/icon.png @@ -81,7 +87,8 @@ www/favicon.ico: $(DUMP)/ui/icon.png $(DUMP)/ui/bt-cf-unchecked.webp $(DUMP)/ui/bt-cf-checked.webp: %.webp: %.png $(CONVERT) -trim $< $< - $(OPTIPNG) -o7 $< + $(PNGQUANT) --force --speed 1 --ext .png $< + $(TRUEPNG) $< /o max $(ZOPFLIPNG) -m -y $< $< $(CWEBP) -q 99 -m 6 $< -o $@ diff --git a/README b/README index 7d54461..f1d79fb 100644 --- a/README +++ b/README @@ -6,7 +6,16 @@ This is a WIP HTML5 implementation of the game Katawa Shoujo. [0] - Bash - ffmpeg with fdk-aac, libtheora, libvpx, libx264 - opusenc from opus-tools +- TruePNG +- DeflOpt +- defluff +- pngquant +- recommended: jpegmini +- jpegrescan - cwebp and webpmux from libwebp +- ImageMagick +- apngasm +- uglifyjs === Recommended === - nginx @@ -19,7 +28,8 @@ This is a WIP HTML5 implementation of the game Katawa Shoujo. [0] 0. Get Katawa Shoujo. 1. Copy *.rpyc from Katawa Shoujo/game into unrpyc/ directory. 2. Extract files from Katawa Shoujo/game/data.rpa with an rpa extractor, e.g. unrpa. Put files in www/dump. -3. Run setup.sh. [2] +3. Install prerequisites, download DeflOpt and defluff and place exes in this directory. +4. Run setup.sh. [2] 4. Run nginx.sh to start nginx, then navigate to localhost:8080 in your browser. -- or -- diff --git a/nginx.inc.conf b/nginx.inc.conf index b795a1c..acab0ef 100644 --- a/nginx.inc.conf +++ b/nginx.inc.conf @@ -14,19 +14,19 @@ location ~ ^/(css/font|js/lib)/ { location / { set $warned NO; if ($http_cookie ~ "warned") { - set $warned YES; + set $warned YES; } if ($args ~ "warned") { - set $warned YES; + set $warned YES; } if ($warned = NO) { - return 307 /warn.html; + return 307 /warn.html; } } -location /setcookie.html { +location /warned.ngx { add_header Set-Cookie "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly"; - return 301 /; + return 301 "/warned.html?$args&language=$http_accept_language"; } location /warn.html { @@ -40,3 +40,5 @@ location /robots.txt { expires 5s; add_header Cache-Control public; add_header X-UA-Compatible "IE=edge"; + +# vim:ft=nginx: diff --git a/www/warn.html b/www/warn.html index 5d41083..5c7c898 100644 --- a/www/warn.html +++ b/www/warn.html @@ -6,13 +6,16 @@

Okay, before we start, we need to go through a few things first.

If you don't know what Katawa Shoujo is, see http://www.katawa-shoujo.com/, then come back.

-

The full version of Katawa Shoujo contains adult material.
- Promise that you are over 18 years old and that you will not make the material available to persons below that age. -

+

There's like, a little bit of... inappropriate content, so we have to make you promise you're over 18.

+

If you don't want to see any, er, explicit content, hit the appropriate checkbox at the bottom of the page.

Also, please don't bother the original developers on the forums or IRC about bugs in this. This is entirely unofficial and not controlled by them whatsoever.
- This includes typos, graphical misplacement, downtime, and any other glitches of any sort. Bug me instead: https://bugzilla.happinessforme.com/, or use the official distribution until HTML5KS is feature-complete. + This includes missing features, typos, downtime, and any other glitches of any sort. Bug me instead: https://bugzilla.happinessforme.com/, or use the official distribution until HTML5KS is feature-complete.

-

FYI, this site sets a single anonymous cookie (warned=1) so that you won't have to keep seeing this page. It also sets localStorage to keep your settings and saves (when that's implemented). This stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.

-

OK? Great.

+

FYI, this site sets a single anonymous cookie (warned=1) so that you won't have to keep seeing this page. It also sets localStorage to keep your settings and saves. The latter always stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.

+
+

+
+ +

diff --git a/www/warned.html b/www/warned.html new file mode 100644 index 0000000..5d44d7c --- /dev/null +++ b/www/warned.html @@ -0,0 +1,10 @@ + + + +If you're seeing this, something's gone wrong. Go back and report a bug. -- cgit v1.2.3-70-g09d2