OSDN Git Service

原作のv1.5.1へのバージョンアップに対応する修正
authormaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 16 Jan 2016 06:33:13 +0000 (15:33 +0900)
committermaruhiro <maruhiro@bridge.ocn.ne.jp>
Sat, 16 Jan 2016 09:15:49 +0000 (18:15 +0900)
167 files changed:
.gitignore
LICENSES
Makefile
README-jp.txt
README.txt
data/aliens0.dat [deleted file]
data/aliens11.dat [deleted file]
data/aliens13.dat [deleted file]
data/aliens14.dat [deleted file]
data/aliens16.dat [deleted file]
data/aliens17.dat [deleted file]
data/aliens18.dat [deleted file]
data/aliens19.dat [deleted file]
data/aliens2.dat [deleted file]
data/aliens20.dat [deleted file]
data/aliens21.dat [deleted file]
data/aliens22.dat [deleted file]
data/aliens23.dat [deleted file]
data/aliens25.dat [deleted file]
data/aliens26.dat [deleted file]
data/aliens3.dat [deleted file]
data/aliens4.dat [deleted file]
data/aliens5.dat [deleted file]
data/aliens7.dat [deleted file]
data/aliens8.dat [deleted file]
data/aliens9.dat [deleted file]
data/brief1.txt [deleted file]
data/brief10.txt [deleted file]
data/brief11.txt [deleted file]
data/brief12.txt [deleted file]
data/brief13.txt [deleted file]
data/brief14.txt [deleted file]
data/brief15.txt [deleted file]
data/brief16.txt [deleted file]
data/brief17.txt [deleted file]
data/brief18.txt [deleted file]
data/brief19.txt [deleted file]
data/brief2.txt [deleted file]
data/brief20.txt [deleted file]
data/brief21.txt [deleted file]
data/brief22.txt [deleted file]
data/brief23.txt [deleted file]
data/brief24.txt [deleted file]
data/brief25.txt [deleted file]
data/brief26.txt [deleted file]
data/brief3.txt [deleted file]
data/brief4.txt [deleted file]
data/brief5.txt [deleted file]
data/brief6.txt [deleted file]
data/brief7.txt [deleted file]
data/brief8.txt [deleted file]
data/brief9.txt [deleted file]
data/credits.txt
data/cutscene0.dat [deleted file]
data/cutscene1.dat [deleted file]
data/cutscene2.dat [deleted file]
data/cutscene3.dat [deleted file]
data/cutscene4.dat [deleted file]
data/cutscene5.dat [deleted file]
data/cutscene6.dat [deleted file]
data/planets_eyananth.dat [deleted file]
data/planets_mordor.dat [deleted file]
data/planets_sol.dat [deleted file]
data/planets_spirit.dat [deleted file]
data/resources_all.dat [deleted file]
data/resources_eyananth.dat [deleted file]
data/resources_mordor.dat [deleted file]
data/resources_sol.dat [deleted file]
data/resources_spirit.dat [deleted file]
data/script11.txt [deleted file]
data/script13.txt [deleted file]
data/script16.txt [deleted file]
data/script17.txt [deleted file]
data/script22.txt [deleted file]
data/script23.txt [deleted file]
data/script25.txt [deleted file]
data/script26.txt [deleted file]
data/script5.txt [deleted file]
data/script7.txt [deleted file]
data/script8.txt [deleted file]
docs/arrowNorthEast.png
docs/dollar.png
docs/heart.png
docs/index.html
docs/plasmaAmmo.png
docs/plasmaDamage.png
docs/plasmaRate.png
docs/rocket.png
docs/rocketAmmo.png
docs/sflogo.png
docs/superCharge.png
gfx/friendArrowEast.png [new file with mode: 0644]
gfx/friendArrowNorth.png [new file with mode: 0644]
gfx/friendArrowNorthEast.png [new file with mode: 0644]
gfx/friendArrowNorthWest.png [new file with mode: 0644]
gfx/friendArrowSouth.png [new file with mode: 0644]
gfx/friendArrowSouthEast.png [new file with mode: 0644]
gfx/friendArrowSouthWest.png [new file with mode: 0644]
gfx/friendArrowWest.png [new file with mode: 0644]
gfx/klineText.png [new file with mode: 0644]
gfx/phoebeText.png [new file with mode: 0644]
gfx/sidText.png [new file with mode: 0644]
gfx/ursulaText.png [new file with mode: 0644]
icon.ico [deleted file]
misc/starfighter.desktop [new file with mode: 0644]
misc/starfighter.png [new file with mode: 0644]
resource.rc [deleted file]
src/Starfighter.cpp
src/Starfighter.h
src/alien.cpp
src/alien.h
src/audio.cpp
src/audio.h
src/bullet.cpp
src/bullet.h
src/cargo.cpp
src/cargo.h
src/collectable.cpp
src/collectable.h
src/colors.cpp [new file with mode: 0644]
src/colors.h [new file with mode: 0644]
src/cutscene.cpp [new file with mode: 0644]
src/cutscene.h [moved from src/init.h with 77% similarity]
src/defs.h
src/engine.cpp
src/engine.h
src/event.cpp [new file with mode: 0644]
src/event.h [new file with mode: 0644]
src/explosion.cpp
src/explosion.h
src/game.cpp
src/game.h
src/gfx.cpp [new file with mode: 0644]
src/gfx.h [new file with mode: 0644]
src/graphics.cpp [deleted file]
src/graphics.h [deleted file]
src/init.cpp [deleted file]
src/intermission.cpp
src/intermission.h
src/loadSave.cpp
src/loadSave.h
src/messages.cpp
src/messages.h
src/misc.cpp
src/misc.h
src/missions.cpp
src/missions.h
src/player.cpp
src/player.h
src/renderer.cpp [new file with mode: 0644]
src/renderer.h [moved from src/script.h with 77% similarity]
src/resources.cpp
src/resources.h
src/screen.cpp [new file with mode: 0644]
src/screen.h [new file with mode: 0644]
src/script.cpp [deleted file]
src/ship.cpp
src/ship.h
src/shop.cpp
src/shop.h
src/structs.h
src/title.cpp
src/title.h
src/weapons.cpp
src/weapons.h
src/window.cpp [new file with mode: 0644]
src/window.h [new file with mode: 0644]

index 0e32c16..9d0f212 100644 (file)
@@ -48,3 +48,13 @@ player.o
 weapons.o
 zlib1.dll
 resource.o
+starfighter-1.5.1-win32.patch
+gfx.o
+colors.o
+cutscene.o
+event.o
+renderer.o
+screen.o
+window.o
+resource.rc
+icon.ico
index 9f08bcf..9c1299f 100644 (file)
--- a/LICENSES
+++ b/LICENSES
@@ -61,6 +61,11 @@ gfx/targetText.png
 
 Author: Astrid S. de Wijn
 License: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>
+Notes:
+  The text in these images was made by rendering the
+  DejaVu Sans Mono Bold font in the GIMP.  smallFont.png uses size 13pt
+  with anti-aliasing off, while the other images use size 10pt with
+  anti-aliasing on.
 
 ------------------------------------------------------------------------
 
@@ -72,6 +77,35 @@ Source: http://members.at.infoseek.co.jp/yu_izumi/izumi-bf/dl-jp.html
 
 ------------------------------------------------------------------------
 
+gfx/friendArrowEast.png
+gfx/friendArrowNorth.png
+gfx/friendArrowNorthEast.png
+gfx/friendArrowNorthWest.png
+gfx/friendArrowSouth.png
+gfx/friendArrowSouthEast.png
+gfx/friendArrowSouthWest.png
+gfx/friendArrowWest.png
+
+Authors:
+  Astrid S. de Wijn
+  onpon4
+License: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>
+
+------------------------------------------------------------------------
+
+gfx/klineText.png
+gfx/phoebeText.png
+gfx/sidText.png
+gfx/ursulaText.png
+
+Author: onpon4
+License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
+Notes:
+  Made by rendering the DejaVu Sans Mono Bold font in the GIMP at size
+  10pt wih anti-aliasing on.
+
+------------------------------------------------------------------------
+
 gfx/face_chris.png
 gfx/face_phoebe.png
 gfx/face_sid.png
index 0a514db..4242a92 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,22 @@
 CXXFLAGS ?= -O2 -Wall -g
 CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
 LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
-OBJS = alien.o audio.o bullet.o cargo.o collectable.o engine.o explosion.o game.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o
+OBJS = alien.o audio.o bullet.o cargo.o collectable.o colors.o cutscene.o engine.o event.o explosion.o game.o gfx.o intermission.o loadSave.o messages.o misc.o missions.o player.o renderer.o resources.o screen.o ship.o shop.o Starfighter.o title.o weapons.o window.o
 
-VERSION = 1.4
+VERSION = 1.5.1
 PROG = starfighter
 DOCS = docs/*
 DATA = data gfx sound music
 DATAFILES = data/* gfx/* sound/* music/*
+LAUNCHER = misc/starfighter.desktop
+ICON = misc/starfighter.png
 
 PREFIX ?= /usr
 BINDIR ?= $(PREFIX)/games/
 DATADIR ?= $(PREFIX)/share/games/parallelrealities/
 DOCDIR ?= $(PREFIX)/share/doc/$(PROG)/
+MENUDIR ?= $(PREFIX)/share/applications/
+ICONDIR ?= $(PREFIX)/share/pixmaps/
 
 # top-level rule to create the program.
 ALL = $(PROG)
@@ -36,10 +40,14 @@ install: $(ALL)
        mkdir -p $(DESTDIR)$(BINDIR)
        mkdir -p $(DESTDIR)$(DATADIR)
        mkdir -p $(DESTDIR)$(DOCDIR)
+       mkdir -p $(MENUDIR)
+       mkdir -p $(ICONDIR)
 
        install -m 755 $(PROG) $(DESTDIR)$(BINDIR)$(PROG)
-       cp -pr $(DATA) $(DESTDIR)$(DATADIR)
-       cp -p $(DOCS) $(DESTDIR)$(DOCDIR)
+       cp -r $(DATA) $(DESTDIR)$(DATADIR)
+       cp $(DOCS) $(DESTDIR)$(DOCDIR)
+       cp $(LAUNCHER) $(MENUDIR)
+       cp $(ICON) $(ICONDIR)
 
 optimise:
        advpng -z gfx/*.png
index a066872..e351d12 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (C) 2015 Julian Marchant <onpon4@riseup.net>
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -24,14 +24,20 @@ Starfighterで遊んだことがあれば、オリジナルとこのバージョ
 づくだろう。
 
 * グラフィック、効果音、音楽は全て異なる。これは、元のバージョンのものは
-  æ­£å¼\8fã\81ªã\83©ã\82¤ã\82»ã\83³ã\82¹ã\81«å\9fºã\81¥ã\81\84ã\81¦ã\81\84ã\81ªã\81\8bã\81£ã\81\9fã\81\9fã\82\81ã\80\81100%è\87ªç\94±ã\81§å\90\88æ³\95ã\81ªã\82\82ã\81®ã\81«ç½®ã\81\8dæ\8f\9b
-  える必要があったためである。ほとんどは以前のSourceForgeでのプロジェク
-  トの段階で行われた。このプロジェクトで新しい音楽が追加され、バージョン
-  1.2の段階で手違いで組み込まれた自由でないグラフィックは置き換えられた。
+  æ­£å¼\8fã\81ªã\83©ã\82¤ã\82»ã\83³ã\82¹ã\81«å\9fºã\81¥ã\81\84ã\81¦ã\81\84ã\81ªã\81\8bã\81£ã\81\9fã\81\9fã\82\81ã\80\81100%è\87ªç\94±ã\81ªã\82\82ã\81®ã\81«ç½®ã\81\8dæ\8f\9bã\81\88ã\82\8bå¿\85
+  要があったためである。ほとんどは以前のSourceForgeでのプロジェクトの段
+  階で行われた。このプロジェクトで新しい音楽が追加され、バージョン1.2の
+  段階で手違いで組み込まれた自由でないグラフィックは置き換えられた。
 
 * ゲーム内容が一部変更された。ほとんどの変更はゲームバランスを良くするた
   めのものである。しかし、もしオリジナルと同じ内容で遊びたいならば、可能
-  な限り(バグ修正以外は)元に近い「オリジナル」の難易度も選択できる。
+  な限り元に近い「旧版」の難易度も選択できる。
+
+* 多くのセリフが変更された。これには多くの理由-誤字、新しい音楽に合わせ
+  る、登場人物の個性を強めるなどのためである。
+
+* 多くの場面でインターフェースが再構築された。例えば、矢印はオリジナルで
+  は1種類であったが、これは艦ごとに異なるように変更された。
 
 * タイトルで"humansdoitbetter"と入力してもチートモードにはならない。SDL2
   に切り替えたところ、これを修正するのは難しく、別の方法に置き換えること
@@ -65,20 +71,20 @@ Project: Starfighterは次のライブラリに依存している:
 
 日本語版のビルド方法
 
-1. オリジナル(英語)のProject: Starfighterのソースを展開する。
-2. 日本語版のアーカイブ starfighter-1.4-jp-src.tgz を展開する。
+1. オリジナル(英語)のProject: Starfighter v1.5.1 のソースを展開する。
+2. 日本語版のアーカイブ starfighter-1.5.1-jp-src.tgz を展開する。
 3. 日本語版の gfx/smallFont.png をオリジナルの gfx/ にコピーし上書きす
    る。
-4. 日本語版の starfighter-1.4-jp.patch をオリジナルのルートディレクトリ
+4. 日本語版の starfighter-1.5.1-jp.patch をオリジナルのルートディレクトリ
    にコピーする。
 5. オリジナルのルートディレクトリで
 
-   patch -p1 < starfighter-1.4-jp.patch
+   patch -p1 < starfighter-1.5.1-jp.patch
 
    を実行する。
 
 6. make を実行する。
 
-win32版をビルドする場合は starfighter-1.4-win32.patch.gz を展開し、パッ
+win32版をビルドする場合は starfighter-1.5.1-win32.patch.gz を展開し、パッ
 チを当てる必要がある。
 このパッチは日本語版・オリジナルの両方で使える。
index a7ee90b..a23a226 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (C) 2015 Julian Marchant <onpon4@riseup.net>
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -23,15 +23,22 @@ compared to the original:
 
 * The graphics, sounds, and music are all completely different. This is
   because most of the original media was not properly licensed, and
-  therefore needed to be replaced to make the game 100% libre and legal.
-  Most of this work was done by the previous project at SourceForge;
-  this project completed that work by adding music and replacing one
+  therefore needed to be replaced to make the game 100% libre. Most of
+  this work was done by the previous project at SourceForge; the current
+  project completed that work by adding music and replacing one
   non-libre graphic that got into version 1.2 by mistake.
 
 * There are several gameplay changes. These changes were mostly done to
   balance the game better. However, if you want the original experience,
-  "original" difficulty approximates it as closely as possible (short of
-  implementing bugs on purpose).
+  "Classic" difficulty approximates it as closely as possible.
+
+* Much of the dialog has been changed. There are various reasons for
+  this; some of these include fixing bad writing, making the dialog
+  match new music queues, and giving the characters more personality.
+
+* In many places, the interface has been considerably improved. As an
+  example, the simplistic target arrow of the original has been replaced
+  with a system of several arrows, one for each ship.
 
 * Typing "humansdoitbetter" in the title screen no longer enables
   cheats. This is actually because the switch to SDL2 broke the original
diff --git a/data/aliens0.dat b/data/aliens0.dat
deleted file mode 100644 (file)
index ff59ce6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-0 7
--1
diff --git a/data/aliens11.dat b/data/aliens11.dat
deleted file mode 100644 (file)
index de4b8fe..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-14 15
-13 17
-12 18
-11 16
-10 19
-15 10
-
-20 12
-21 12
--1
diff --git a/data/aliens13.dat b/data/aliens13.dat
deleted file mode 100644 (file)
index dded96f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-14 22
--1
diff --git a/data/aliens14.dat b/data/aliens14.dat
deleted file mode 100644 (file)
index 7999c55..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-14 15
-13 17
-12 18
-11 16
-10 19
-19 29
-20 29
--1
diff --git a/data/aliens16.dat b/data/aliens16.dat
deleted file mode 100644 (file)
index 9938270..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-10 21
-11 21
-12 21
-19 23
--1
diff --git a/data/aliens17.dat b/data/aliens17.dat
deleted file mode 100644 (file)
index 7fc91a1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-0 27
-1 27
-2 27
-3 27
-4 27
-14 24
--1
diff --git a/data/aliens18.dat b/data/aliens18.dat
deleted file mode 100644 (file)
index 12f8a05..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-14 24
--1
diff --git a/data/aliens19.dat b/data/aliens19.dat
deleted file mode 100644 (file)
index 5d3a477..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-10 31
-11 31
-12 31
-13 31
-14 30
-20 31
-21 31
--1
diff --git a/data/aliens2.dat b/data/aliens2.dat
deleted file mode 100644 (file)
index d12520e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-0 8
-1 8
-2 8
-3 8
-4 8
-5 8
--1
diff --git a/data/aliens20.dat b/data/aliens20.dat
deleted file mode 100644 (file)
index a28e594..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-10 33
-11 33
-12 33
-13 33
-14 32
-20 33
--1
diff --git a/data/aliens21.dat b/data/aliens21.dat
deleted file mode 100644 (file)
index 6156c6c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-12 37
-13 38
-14 36
--1
diff --git a/data/aliens22.dat b/data/aliens22.dat
deleted file mode 100644 (file)
index 56d2099..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-9 28
-10 28
-11 28
-12 28
-13 28
-14 28
--1
diff --git a/data/aliens23.dat b/data/aliens23.dat
deleted file mode 100644 (file)
index 5284dbd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-10 35
-11 35
-12 35
-13 35
-14 23
--1
diff --git a/data/aliens25.dat b/data/aliens25.dat
deleted file mode 100644 (file)
index d5d45d4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-15 10
--1
diff --git a/data/aliens26.dat b/data/aliens26.dat
deleted file mode 100644 (file)
index d5d45d4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-15 10
--1
diff --git a/data/aliens3.dat b/data/aliens3.dat
deleted file mode 100644 (file)
index 569640d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-0 1
-1 1
-2 1
-3 1
-4 1
--1
diff --git a/data/aliens4.dat b/data/aliens4.dat
deleted file mode 100644 (file)
index 3c64cae..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-0 9
-1 9
-2 9
-3 9
-4 9
-5 9
-6 9
-7 9
-8 9
--1 
diff --git a/data/aliens5.dat b/data/aliens5.dat
deleted file mode 100644 (file)
index ac2fe0a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-12 6
-13 5
-14 4
--1
diff --git a/data/aliens7.dat b/data/aliens7.dat
deleted file mode 100644 (file)
index 682bc72..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-0 8
--1
diff --git a/data/aliens8.dat b/data/aliens8.dat
deleted file mode 100644 (file)
index 4246b4d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-19 13
--1
diff --git a/data/aliens9.dat b/data/aliens9.dat
deleted file mode 100644 (file)
index 4d7d6d2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-20 8
-21 8
-22 8
-23 8
-24 8
--1
diff --git a/data/brief1.txt b/data/brief1.txt
deleted file mode 100644 (file)
index 71fa71f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼
-FACE_KRASS
-¤ª¤¤¡¢¾®ÁÎ! ¤ªÁ°¤Î¤¿¤á¤ËÅð¤ó¤Ç¤ä¤Ã¤¿¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ÎÂå¶â¤¬¤Þ¤À¤À¤¾! ¤À¤¬¡¢¤½¤ÎÂå¤ï¤ê¤ËWEAPCO¤Î·±Îý¾ì¤Ø¹Ô¤Ã¤Æ¡¢¤½¤³¤ÇÁ´¤Æ¤Î´Ï¤òÇ˲õ¤·¤Æ¤¯¤ì¡£
-FACE_CHRIS
-²¿? ¤½¤ì¤Ï²¶¤¬¤ªÁ°¤ËÍê¤ó¤À»Å»ö¤À¤í¤¦?
-FACE_KRASS
-ʬ¤«¤Ã¤Æ¤¤¤ë¡£¤À¤¬¡¢¤³¤ÎÊýË¡¤Ê¤é¤ªÁ°¤Ï¤¹¤°¤Ë¼Ú¤ê¤òÊÖ¤»¤ë¤¾¡£¤³¤Î»Å»ö¤ò¤·¤Æ¡¢¤µ¤é¤Ë$500²Ô¤¤¤Ç¤³¤¤¡£¤³¤ì¤ÇÄ¢¾Ã¤·¤À¡£¤â¤·¤ªÁ°¤¬»à¤ó¤À¤é¡Ä¤½¤¦¤À¤Ê¡¢¤½¤Î´Ï¤Ë¤ÏÅð¤à¤À¤±¤Î²ÁÃͤ¬¤Ê¤«¤Ã¤¿¤Ã¤Æ¤³¤È¤À! ¥Ï¥Ã¥Ï¥Ã¥Ï¥Ã!
-FACE_CHRIS
-ÁêÊѤï¤é¤º¿Í»È¤¤¤¬¹Ó¤¤¤Ê¡¢¥¯¥é¥¹¡£
-
diff --git a/data/brief10.txt b/data/brief10.txt
deleted file mode 100644 (file)
index 3df6384..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-WEAPCO¤Î²Ê³Ø¼Ô¤¬¥Ý¥Ã¥É¤ÇæÁö¤·¡¢¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ë±£¤ì¤Æ¤¤¤ë¤é¤·¤¤¡£µß½Ð¤Ç¤­¤ì¤Ð¥â¥ë¥É¡¼¥ë·Ï¤Î¾ðÊó¤òʹ¤±¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
-FACE_CHRIS
-¤¹¤°¹Ô¤³¤¦¡£
diff --git a/data/brief11.txt b/data/brief11.txt
deleted file mode 100644 (file)
index 463791b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹
-FACE_SID
-²æ¡¹¤¬µß½Ð¤·¤¿ÅÛÎ줿¤Á¤¬È¿Íð¤òµ¯¤³¤·¤¿¤È¤Î¾ðÊó¤¬Æþ¤Ã¤¿¡£·×²è¤Ï¤¦¤Þ¤¯¿Ê¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£
-FACE_PHOEBE
-WEPCO¤Î̵¿ÍºÎ·¡Á¥¤¬¥¨¥é¥á¡¼¥ë¤Îµ°Æ»¾å¤Ë¤¢¤ë¤ï¡£¤³¤ì¤òÇ˲õ¤·¤Æ³ÉÍ𤹤ë¤Î¤Ï¤É¤¦?
-FACE_CHRIS
-¤¤¤¤¥¢¥¤¥Ç¥¢¤À!
-FACE_SID
-¤½¤ì¤Ï¤¦¤Þ¤¯¹Ô¤¯¤À¤í¤¦¡£¤À¤¬ÌýÃǤ¹¤ë¤Ê¡£
diff --git a/data/brief12.txt b/data/brief12.txt
deleted file mode 100644 (file)
index 9f5c598..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_CHRIS
-»îºîÀïÆ®µ¡¤Î¤³¤È¤Ï²¿¤«Ê¬¤«¤Ã¤¿¤«?
-FACE_SID
-¥ì¡¼¥À¡¼¤Ë±Ç¤é¤Ê¤¤¼×ÊÃÁõÃ֤ΰì¼ï¤òÅëºÜ¤·¤Æ¤¤¤ë¡£ÄÉÀפϺ¤Æñ¤À¡£
-FACE_CHRIS
-¶öÁ³½Ð²ñ¤¦¤Þ¤ÇÈô¤Ó²ó¤ë¤·¤«¤Ê¤¤¤Ê¡£
-FACE_SID
-¤¿¤È¤¨Áø¶ø¤·¤Æ¤âÁê¼ê¤Ïƨ¤²¤ë¤À¤í¤¦¡£¸«¤Ä¤±¤¿¤é²Äǽ¤Ê¸Â¤ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤À¡£
diff --git a/data/brief13.txt b/data/brief13.txt
deleted file mode 100644 (file)
index 1a16ceb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹
-FACE_PHOEBE
-»Ð¤µ¤ó¤Î´Ï¤ò¥ª¥Ç¥ª¥ó¤Îµ°Æ»¾å¤Ç¸«¤Ä¤±¤¿¡£¤Ç¤â¡¢¤³¤Á¤é¤ÎÄÌ¿®¤ò̵»ë¤·¤Æ¤¤¤ë¤Î¡£
-FACE_SID
-·ù¤Êͽ´¶¤¬¤¹¤ë¤Ê¡£Èà½÷¤ÏWEAPCO¤Î½¸ÃĤÎÃæ¤ò¼«Í³¤Ë°ÜÆ°¤·¤Æ¤¤¤ë¡£
-FACE_CHRIS
-¿²Ê֤俤Τ«?
-FACE_PHOEBE
-¤¢¤ê¤¨¤Ê¤¤¡£WEAPCO¤ò¤È¤Æ¤âÁþ¤ó¤Ç¤¤¤¿¤â¤Î¡£
-FACE_SID
-¥Þ¥¤¥ó¥É¥³¥ó¥È¥í¡¼¥ë¤Î°ì¼ï¤«¤â¤·¤ì¤Ê¤¤¡£WEAPCO¤¬ºÇ¶á¿·¤·¤¤¡ÖAI¥È¥ì¡¼¥Ë¥ó¥°¥×¥í¥°¥é¥à¡×¤ò³«È¯Ãæ¤À¤Èʹ¤¤¤¿¡£Á᤯½õ¤±¤¿¤Û¤¦¤¬Îɤ¤¤Ê!
diff --git a/data/brief14.txt b/data/brief14.txt
deleted file mode 100644 (file)
index 7fe4ac8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-²òÊü·³¤Ë¤è¤ë¹¶·â¤Î·×²è¤¬¤¢¤ë¡£Èà¤é¤ò»Ù±ç¤·¾¡Íø¤Ç¤­¤ì¤Ð¡¢»Îµ¤¤ÏÂ礤¤Ë¹â¤Þ¤ë¤À¤í¤¦¡£
-FACE_CHRIS
-¤¹¤²¤¨! ¤¹¤°½Ð·â¤À!
diff --git a/data/brief15.txt b/data/brief15.txt
deleted file mode 100644 (file)
index 1899240..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-WEAPCO¤ÎºÎ·¡Á¥¤«¤éÃ¥¤¦¤Î¤Ï¡¢¤¢¤Þ¤ê¤è¤¤ÊýË¡¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£¤À¤¬¡¢¤¢¤Î¥¢¥¹¥Æ¥í¥¤¥É¤Î¹ÛÀФÏÉð´ï¤ÎÀ¸»º¤ËɬÍפÀ¡£
-FACE_CHRIS
-¤ª¤¤¤ª¤¤! ¤Ä¤Þ¤ê¡¢²¶¤Ë¼è¤ê¤Ë¹Ô¤±¤È¸À¤Ã¤Æ¤¤¤ë¤Î¤«?
-FACE_SID
-¤½¤ÎÄ̤ê¤À¡£Ãí°Õ¤·¤í¡¢¥¯¥ê¥¹¡£·¯¤ÎÉð´ï¤Ï¤½¤Î¤è¤¦¤Êºî¶È¤Î¤¿¤á¤ËÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¡¢½ÅÂç¤ÊÌäÂê¤ò°ú¤­µ¯¤³¤¹¤«¤â¤·¤ì¤Ê¤¤¡£
diff --git a/data/brief16.txt b/data/brief16.txt
deleted file mode 100644 (file)
index 4a26189..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼
-FACE_CHRIS
-¤ª¤¤¥¯¥é¥¹! ¼êÅÁ¤Ã¤Æ¤¯¤ì¡£¥Õ¥§¡¼¥Ù¤È¥¦¡¼¥·¥å¥é¤¬WEAPCO¤Î½ÅÍפʥץé¥ó¥È¤òÇ˲õ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£¤Á¤ç¤Ã¤ÈÁû¤®¤òµ¯¤³¤·¤Æ¡¢¤³¤Á¤é¤ËÃí°Õ¤ò°ú¤­ÉÕ¤±¤é¤ì¤Ê¤¤¤«?
-FACE_KRASS
-¤¤¤¤¤¾¡¢½õ¤±¤Æ¤ä¤í¤¦¡£¤À¤¬¡¢¶â¤À¡Ä
diff --git a/data/brief17.txt b/data/brief17.txt
deleted file mode 100644 (file)
index e1e95f3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹
-FACE_URSULA
-»×¤¤½Ð¤·¤¿¤¾¡£WEAPCO¤Ï²¿¿Í¤â¤Î½ÅÌò¤ò¥Ý¥¹¥¤¥Ã¥¯¤ËÁ÷¤Ã¤Æ¤¤¤ë¡£
-FACE_SID
-¤½¤ì¤ÏÂÀÍ۷ϤǤξ¡Íø¤Î¤¿¤á¤Ë¶Ë¤á¤Æ½ÅÍפʤ³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£»ä¤â¤½¤Î´Ï¤ò¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¤¿¤á¤Ë»²²Ã¤¹¤ë¡£
-FACE_CHRIS
-Íê¤à¤¾!
diff --git a/data/brief18.txt b/data/brief18.txt
deleted file mode 100644 (file)
index 36a07d4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹
-FACE_CHRIS
-¥Õ¥§¡¼¥Ù¡¢¤ªÁ°¤Ï¤³¤³¤ò¸«Ä¥¤Ã¤Æ¤Æ¤¯¤ì¡£²¶¤Ï¤¢¤Î´Ï¤òÄɤ¦!
-FACE_PHOEBE
-Äɤ¤¤Ä¤±¤ë¤È»×¤Ã¤Æ¤ë¤Î?
-FACE_CHRIS
-Æñ¤·¤¤¤«¤Ã¤Æ? ¥Ï¥Ï¡¢¿´ÇÛ¤¹¤ë¤Ê¡£¤³¤Î¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¥¹¥Ô¡¼¥É¤¬¤¢¤ì¤Ð¡£¸å¤Ç¸«¤»¤Æ¤ä¤ë¤è¡£
diff --git a/data/brief19.txt b/data/brief19.txt
deleted file mode 100644 (file)
index a2d9487..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¤Þ¤º³°ÏÇÀ±¤òÀ©°µ¤·¡¢¤½¤³¤«¤éÀÚ¤ê¹þ¤à¡£¤½¤¦¤¹¤ì¤ÐºÇ¸å¤ÎºîÀï¤Î¤È¤­Î¾Â¦¤«¤é¶´¤Þ¤ì¤ë´í¸±À­¤¬¾®¤µ¤¯¤Ê¤ë¡£
-FACE_PHOEBE
-ʬ¤«¤Ã¤¿¡£
-FACE_URSULA
-OK
-FACE_CHRIS
-λ²ò¡£
diff --git a/data/brief2.txt b/data/brief2.txt
deleted file mode 100644 (file)
index ef9a879..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_CHRIS
-¤è¤ª¡¢¥·¥É¡£¤É¤¦¤«¤·¤¿¤«?
-FACE_SID
-¥¯¥ê¥¹¡¢Í¢Á÷´Ï¤¬WEPCO¤Ë½±¤ï¤ì¤¿¡£¤É¤¦¤ä¤é¥»¥é¥É¥»¤Ë°åÎÅÉʤò±¿¤ó¤Ç¤¤¤¿¤è¤¦¤À¡£Â¿¤¯¤ÎÌ¿¤òµß¤¦¤¿¤á¤ËÀѲ٤ò¼è¤êÌᤵ¤Ê¤±¤ì¤Ð!
-FACE_CHRIS
-¤¤¤¯¤Ä¤¢¤ë¤ó¤À?
-FACE_SID
-Á´Éô¤Ç6¤Ä¤À! ¤â¤·1¤Ä¤Ç¤â¼º¤¨¤Ð¡¢¿ô¥ö·î¤ÎÆâ¤Ë¤³¤Î¥¹¥Ô¥ê¥Ã¥È·Ï¤Î¿Í¡¹¤¬²¿Àé¿Í¤â»à¤ó¤Ç¤·¤Þ¤¦¤À¤í¤¦¡£
-
diff --git a/data/brief20.txt b/data/brief20.txt
deleted file mode 100644 (file)
index a2d9487..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¤Þ¤º³°ÏÇÀ±¤òÀ©°µ¤·¡¢¤½¤³¤«¤éÀÚ¤ê¹þ¤à¡£¤½¤¦¤¹¤ì¤ÐºÇ¸å¤ÎºîÀï¤Î¤È¤­Î¾Â¦¤«¤é¶´¤Þ¤ì¤ë´í¸±À­¤¬¾®¤µ¤¯¤Ê¤ë¡£
-FACE_PHOEBE
-ʬ¤«¤Ã¤¿¡£
-FACE_URSULA
-OK
-FACE_CHRIS
-λ²ò¡£
diff --git a/data/brief21.txt b/data/brief21.txt
deleted file mode 100644 (file)
index a2d9487..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¤Þ¤º³°ÏÇÀ±¤òÀ©°µ¤·¡¢¤½¤³¤«¤éÀÚ¤ê¹þ¤à¡£¤½¤¦¤¹¤ì¤ÐºÇ¸å¤ÎºîÀï¤Î¤È¤­Î¾Â¦¤«¤é¶´¤Þ¤ì¤ë´í¸±À­¤¬¾®¤µ¤¯¤Ê¤ë¡£
-FACE_PHOEBE
-ʬ¤«¤Ã¤¿¡£
-FACE_URSULA
-OK
-FACE_CHRIS
-λ²ò¡£
diff --git a/data/brief22.txt b/data/brief22.txt
deleted file mode 100644 (file)
index 1e06752..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-WEAPCO¤ÏÅÚÀ±¤ÈÅ·²¦À±¤Î´Ö¤Ë¹âÅÙ¤ÊËɱҥ饤¥ó¤ò°ú¤¤¤Æ¤¤¤ë¡£¤³¤ì¤ò¼è¤ê½ü¤¯É¬Íפ¬¤¢¤ë¡£
-FACE_URSULA
-¤É¤Î¤è¤¦¤ÊËɱҥ·¥¹¥Æ¥à¤Ê¤Î¤À?
-FACE_SID
-¾®·¿¤ÎÊ£¿ô¤Î°ÜÆ°¤Ç¤­¤ë¥ì¡¼¥¶¡¼Ë¤¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¡£¤«¤Ä¤Æ¥¹¥Ô¥ê¥Ã¥È·Ï¤ÇÀï¤Ã¤¿¥¹¥¿¡¼¥­¥é¡¼¤È¤ÏÁ´¤¯°Û¤Ê¤ë¼ïÎà¤Îʼ´ï¤À¡£
-FACE_PHOEBE
-¤Ê¤é¤Ð¡¢»ä¤Î¥ß¥µ¥¤¥ë¥é¥ó¥Á¥ã¡¼¤ò¤è¤¯ÅÀ¸¡¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Í!
diff --git a/data/brief23.txt b/data/brief23.txt
deleted file mode 100644 (file)
index bc889e7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-³§¤¬¤¤¤Ê¤¤´Ö¤Ë¡¢ÌÚÀ±¼þÊÕ¤«¤éµßÆñ¿®¹æ¤ò¼õ¿®¤·¤¿¡£
-FACE_URSULA
-ÂÀÍÛ·ÏÆâ¤Î郎¿®¹æ¤òÁ÷¤ëɬÍפ¬¤¢¤ë¤Î¤À?
-FACE_CHRIS
-Ä´¤Ù¤Æ¤ß¤è¤¦¡£æ«¤«¤â¤·¤ì¤ó¤¬¡¢²¿¤È¤«¤Ê¤ë¤µ¡£
diff --git a/data/brief24.txt b/data/brief24.txt
deleted file mode 100644 (file)
index 6e4a642..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¥¯¥ê¥¹¡¢¾¯¤·ÌäÂ꤬¤¢¤ë¡£WEAPCO¤Ï¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ëµ¡Í븶¤òÉߤ¤¤Æ¤¤¤ë¡£¤³¤ì¤ò¼è¤ê½ü¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-FACE_CHRIS
-ʬ¤«¤Ã¤¿¡£°ÂÁ´¤ÊÆ»¤òºî¤ì¤¿¤éÏ¢Íí¤¹¤ë¡£
diff --git a/data/brief25.txt b/data/brief25.txt
deleted file mode 100644 (file)
index 61ad528..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Á´°÷
-FACE_CHRIS
-¤è¤·¤ß¤ó¤Ê¡¢¤¤¤è¤¤¤è¤À¡£²¶¤¿¤Á¤Ï¶ì¤·¤¤Ãæ¤ò¤º¤Ã¤È¿Ê¤ó¤Ç¤­¤¿¡£Âफ¤ºÁ´¤Æ¤ÎÎϤÇÅÛ¤é¤ò᤯¤·¤«¤Ê¤¤!
-FACE_SID
-°ú¤­ÊÖ¤¹¤Ë¤Ï±ó¤¹¤®¤ë½ê¤Þ¤ÇÍè¤Æ¤·¤Þ¤Ã¤¿¡£Á´°÷À¸¤­¤Æµ¢¤ë¤ó¤À!
-FACE_PHOEBE
-¹Ô¤­¤Þ¤·¤ç¤¦¡¢¥¯¥ê¥¹¡£
-FACE_URSULA
-»ä¤ÎƬ¤òÁà¤Ã¤¿¤³¤È¤ò¸å²ù¤µ¤»¤Æ¤ä¤ë!
diff --git a/data/brief26.txt b/data/brief26.txt
deleted file mode 100644 (file)
index 01ab52c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_CHRIS
-¥±¥¹¥é¥ó¤Ï¶âÀ±¤Øƨ¤²¤¿¡£²¶¤ÏÅÛ¤òÄɤ¦¡£
-FACE_SID
-µ¤¤ò¤Ä¤±¤Æ¤¯¤ì¡¢¥¯¥ê¥¹¡£²æ¡¹¤ÏÀïÁè¤Ë¾¡Íø¤·¤¿¡£¤Ê¤Î¤Ë·¯¤Ë»à¤Ê¤ì¤¿¤È¤¢¤Ã¤Æ¤ÏÂѤ¨Æñ¤¤ÃÑ¿«¤À!
diff --git a/data/brief3.txt b/data/brief3.txt
deleted file mode 100644 (file)
index b3284f6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_CHRIS
-¤ª¤Ã¤È! ¥ß¥µ¥¤¥ëÄú¤«?
-FACE_SID
-¤½¤¦¤À¡£¤É¤¦¤ä¤éWEPCO¤Ï·¯¤Î¹ÔÆ°¤ËÃíÌܤ·»Ï¤á¤¿¤è¤¦¤À¤Ê¡£
-FACE_CHRIS
-¤ª¤â¤·¤í¤¤! ¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ÎÀïƮǽÎϤΥƥ¹¥È¤Ë¤Ô¤Ã¤¿¤ê¤À!
-FACE_SID
-µ¤¤ò¤Ä¤±¤í¡¢¥¯¥ê¥¹¡£1ÀɤΥߥµ¥¤¥ëÄú¤Ç¤â¼çÍ×ÅÔ»Ô¤òÇ˲õ¤Ç¤­¤ë¤Û¤É¤Î¥í¥±¥Ã¥È¤òÅëºÜ¤·¤Æ¤¤¤ë¡£ÅÛ¤é¤Ë¤ÏÀµÌ̤«¤é¸þ¤«¤ï¤º¡¢½½Ê¬¤Êµ÷Î¥¤òÊݤơ£
-
diff --git a/data/brief4.txt b/data/brief4.txt
deleted file mode 100644 (file)
index c1ef314..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¥¸¥ç¥ë¥À¡¼¼þÊդε¡Íë¤ò½üµî¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£µ¡ÍëÃÏÂӤΤ»¤¤¤ÇÏÇÀ±´Ö¸òÄ̤¬Á˳²¤µ¤ì¤Æ¤¤¤ë¡£
-FACE_CHRIS
-Âà¶þ¤½¤¦¤À¤Ê¡£ÀïÆ®µ¡¤Ï¤¤¤Ê¤¤¤Î¤«?
-FACE_SID
-º£¤Î½ê¤Ï¤Ê¡£¤À¤¬Åۤ餬°ú¤­ÊÖ¤·¤¿¤È¤Ï¸À¤¤ÀÚ¤ì¤Ê¤¤¡£µ¡Íë¤Ë¤Ïµ¤¤ò¤Ä¤±¤í! WEPCO¤Î¿®¹æ¤òȯ¤·¤Æ¤¤¤Ê¤¤´Ï¤Ï¶á¤Å¤¤¤¿¤À¤±¤ÇÇúȯ¤¹¤ë¡£¼ÙËâ¤Ê¤é¤ÐÂǤÁÍî¤È¤»¡£
-
diff --git a/data/brief5.txt b/data/brief5.txt
deleted file mode 100644 (file)
index 0792670..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¶ÛµÞ»öÂÖ¤À! WEPCO¤Ï²æ¡¹¤Î³èÆ°¤ò»ß¤á¤ë¤¿¤á¤Ë¥¹¥Ô¥ê¥Ã¥È¤òÇ˲õ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë! ¤½¤ÎÇúȯ¤ÏÀ±·Ï¤ÎÁ´¤Æ¤ÎÏÇÀ±¤ò´¬¤­¹þ¤à¤À¤í¤¦! ¥Õ¥ê¥²¡¼¥È¤¬¼ÍÄøÆâ¤ËÆþ¤ëÁ°¤ËÇ˲õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤!
-FACE_CHRIS
-ÃÜÀ¸¤á! º£¤¹¤°È¯¿Ê¤¹¤ë!
-FACE_SID
-³§¤¬·¯¤Ë´üÂÔ¤·¤Æ¤¤¤ë¡¢¥¯¥ê¥¹! ¤À¤¬Ëº¤ì¤ë¤Ê - ÅÛ¤é¤Ï·è¤·¤Æ¡Ø¥¹¥¿¡¼¥­¥é¡¼¡Ù¤È¤Ï¸Æ¤Ð¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¤½¤ì¤Ç¤Ï¤­¤ì¤¤²á¤®¤ë¤«¤é¤À!
diff --git a/data/brief6.txt b/data/brief6.txt
deleted file mode 100644 (file)
index c6455a6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-ÃΤäƤÎÄ̤ꡢ¤³¤ÎÀ±·Ï¤Ë¤Ï¤¿¤¯¤µ¤ó¤ÎWEAPCO¤ÎÅÛÎ줬¤¤¤ë¡£Èà¤é¤ò²òÊü¤Ç¤­¤ì¤ÐÈ¿·â¤Î¤­¤Ã¤«¤±¤Ë¤Ê¤ë¤Ï¤º¤À¡£ÊѲ½¤¬¸½¤ì¤ë¤¿¤á¤Ë¤Ï¡¢250¿Í¤Ïµß½Ð¤¹¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£
-FACE_CHRIS
-¤Û¤È¤ó¤É¤ÎÅÛÎì¤ÏºÎ·¡¤ò¤·¤Æ¤¤¤ë¤½¤¦¤À¤Ê¡£
-FACE_SID
-¤½¤¦¤À¡£¤À¤¬¡¢ºÎ·¡½ê¤òľÀܹ¶·â¤¹¤ë¤Î¤Ï´í¸±¤À¡£ÅÛÎì¤ÎÈÂÆþ¤òÁ˻ߤ¹¤ë¤Î¤¬¤¤¤¤¤À¤í¤¦¡£¤¢¤¿¤ê¤òÈô¹Ô¤·¡¢WEPCO¤Î¥Ñ¥È¥í¡¼¥ë¤ò·Þ·â¤·¤í¡£¤â¤Á¤í¤óÅÛÎìÁ¥¤ò¸î±Ò¤·¤Æ¤¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£½½Ê¬¤Ëµ¤¤ò¤Ä¤±¤í!!
diff --git a/data/brief7.txt b/data/brief7.txt
deleted file mode 100644 (file)
index 41dfd3d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-(ÉÔÌÀ)
-FACE_PHOEBE
-½õ¤±¤Æ! SOS! Ã¯¤«Ê¹¤³¤¨¤Æ¤ë?!
-FACE_CHRIS
-¤è¤¯Ê¹¤³¤¨¤ë¤¾! ¤É¤¦¤·¤¿?
-FACE_PHOEBE
-¤¢¤¢¡¢½õ¤«¤Ã¤¿¤ï! ¥Í¥í¥É¼þÊÕ¤ÇWEAPCO¤ÎÂç·²¤Ë°Ï¤Þ¤ì¤Æ¤¤¤ë¤Î! »Ù±ç¤ò!
-FACE_CHRIS
-¤¹¤°¸þ¤«¤¦!
diff --git a/data/brief8.txt b/data/brief8.txt
deleted file mode 100644 (file)
index 7d23947..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-º£¡¢Ê̤ÎSOS¤ò¼õ¿®¤·¤¿¡£½ÅÍפʰåÌôÉʤò±¿¤ÖÍ¢Á÷´Ï¤«¤é¤À¡£
-FACE_CHRIS
-ʬ¤«¤Ã¤¿¡£¤¹¤°¸þ¤«¤¦¤ÈÅÁ¤¨¤Æ¤¯¤ì¡£
diff --git a/data/brief9.txt b/data/brief9.txt
deleted file mode 100644 (file)
index 06393d8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-FACE_SID
-¤³¤ÎÀ±·Ï¤òÎ¥¤ì¤ëÁ°¤Ë¤¤¤¯¤é¤«»ñ¸»¤ò³ÎÊݤ¹¤ëɬÍפ¬¤¢¤ë¡£¤½¤ì¤¬¤¢¤ì¤Ð¥â¥ë¥É¡¼¥ë·Ï¤Ç¤Î³èÆ°¤¬¤è¤ê´Êñ¤Ë¤Ê¤ë¤À¤í¤¦¡£ÌäÂê¤Ï¡¢¤³¤Î¤¢¤¿¤ê¤Ç¤ÏWEAPCO¤·¤«»ý¤Ã¤Æ¤Ê¤¤¤³¤È¤À¡£
-FACE_CHRIS
-¤½¤ì¤Ç¤É¤³¤Ø¹Ô¤±¤Ð¼ê¤ËÆþ¤ë¤ó¤À?
-FACE_SID
-¶á¤¯¤Ë¤½¤ÎÂç·¿Êäµë´Ï¤¬¤¤¤ë¡£»ä¤¬¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¡£·¯¤Ë¤Ï¤½¤Î´Ö¤Î±ç¸î¤ò¤¿¤Î¤à¡£
-FACE_CHRIS
-ʬ¤«¤Ã¤¿!
index def26ea..cdc3601 100644 (file)
@@ -10,7 +10,7 @@
 030 +++ ADDITIONAL PROGRAMMING +++
 020 Richard Sweeney
 020 Guus Sliepen
-020 Julian Marchant
+020 onpon4
 050 +++ QUALITY ASSURANCE AND ADVICE +++
 030 Sam Lantinga  Ian Bissett
 020 Chris Taylor  Xan  Christoph Reichenbach
@@ -65,5 +65,5 @@
 350 Project: Starfighter
 020 Copyright 2003 Parallel Realities
 020 Copyright 2012 Guus Sliepen, Astrid S. de Wijn and others
-020 Copyright 2015 Julian Marchant
+020 Copyright 2015, 2016 onpon4
 120 starfighter.nongnu.org
diff --git a/data/cutscene0.dat b/data/cutscene0.dat
deleted file mode 100644 (file)
index f63545e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-gfx/spirit.jpg
--3 0
-
-0 0 480 300 3.1
-1 2 -100 -550 3
-2 2 -100 -550 3
-3 2 -100 -550 3
-4 2 -100 -550 3
-5 2 -100 -550 3
-6 2 -100 -550 3
-7 2 -100 -550 3
-8 2 -100 -550 3
-9 2 -100 -550 3
-10 2 -100 -550 3
-11 2 -100 -550 3
-12 2 -100 -550 3
-13 2 -100 -550 3
-14 2 -100 -550 3
-
-FACE_NONE
-¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É¤Ï¿·¤¿¤Ë³ÍÆÀ¤·¤¿¡Ø¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¡Ù¤ÇƨÁö¤¹¤ëÅÓÃæ¡¢¤Ä¤¤¤ËWEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤ËÊ᪤µ¤ì¤¿¡Ä
-FACE_CHRIS
-¤Þ¤ÀÄɤäÆÍè¤ë¤Î¤«!?
-FACE_CHRIS
-¤Þ¤À¤³¤Î´Ï¤ÎÁà½Ä¤Ë´·¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¥Ñ¥È¥í¡¼¥ë´Ï¤ò½¸¹çÃÏÅÀ¤Þ¤ÇÏ¢¤ì¤Æ¹Ô¤¯¤ï¤±¤Ë¤Ï¤¤¤«¤Ê¤¤¡Ä
-FACE_CHRIS
-¡Ä¤¤¤º¤ìÀ臘¤³¤È¤Ë¤Ê¤ë¤Î¤À¡£¤Ê¤é¤Ð¤³¤Î´Ï¤ÎÀ­Ç½¤ò»î¤·¤Æ¤ä¤ë!
diff --git a/data/cutscene1.dat b/data/cutscene1.dat
deleted file mode 100644 (file)
index 7035d88..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-gfx/sol.jpg
--0.5 0
-
-0 18 400 300 0.5
-1 2 -800 -550 -3
-2 2 -800 -550 -3
-3 2 -800 -550 -3
-4 2 -800 -550 -3
-5 2 -800 -550 -3
-6 2 -800 -550 -3
-7 2 -800 -550 -3
-8 2 -800 -550 -3
-9 2 -800 -550 -3
-10 2 -800 -550 -3
-11 2 -800 -550 -3
-12 2 -800 -550 -3
-13 2 -800 -550 -3
-14 2 -800 -550 -3
-
-FACE_NONE
-¿ô»þ´Ö¸å¡¢¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É¤Î³èÌö¤ÏÂÀÍ۷ϤޤÇÅÁ¤ï¤Ã¤¿¡£WEAPCO¤Î´ÏÂâ»ÊÎá´±¤ÏÈà¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¹Í¤¨¤Æ¤¤¤¿¡£
-FACE_KLINE
-Ä벦¤ÏÉÔµ¡·ù¤À¤í¤¦¤Ê¡£º£¤ä¥¹¥Ô¥ê¥Ã¥È·Ï¤Ï¤¢¤ÎÈ¿µÕ¼Ô¤Î¥Ñ¥¤¥í¥Ã¥È¤Ë¤è¤Ã¤Æ²òÊü¤µ¤ì¤¿¡£
-FACE_KLINE
-Êó¹ð¤Ë¤è¤ì¤Ð¡¢²æ¡¹¤ÎºÇ¤â¶¯ÎϤʥեꥲ¡¼¥È¤ÎÆâ¤Î°ìÀɤòÂǤÁ¤Î¤á¤¹¤Î¤Ë3ʬ¤È³Ý¤«¤é¤Ê¤«¤Ã¤¿!
-FACE_KLINE
-¤½¤ó¤ÊºÍǽ¤ò»ý¤Ä¼Ô¤Ï¤á¤Ã¤¿¤Ë¤¤¤Ê¤¤¡£Åۤϲ桹¤Î¿·¤·¤¤AI¥È¥ì¡¼¥Ë¥ó¥°¥×¥í¥°¥é¥à¤Î¸õÊä¤È¤·¤Æ¤Ï´°àú¤À!
-FACE_KLINE
-ÅÛ¤ò»¦¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤¬»ÄÇ°¤À¡Ä
diff --git a/data/cutscene2.dat b/data/cutscene2.dat
deleted file mode 100644 (file)
index eea0a85..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-gfx/spirit.jpg
--1.4 0
-
-0 0 200 300 1.5
-1 24 150 260 1.5
-2 -1 0 0 0
-3 -1 0 0 0
-4 -1 0 0 0
-5 -1 0 0 0
-6 -1 0 0 0
-7 -1 0 0 0
-8 -1 0 0 0
-9 -1 0 0 0
-10 -1 0 0 0
-11 -1 0 0 0
-12 -1 0 0 0
-13 -1 0 0 0
-14 -1 0 0 0
-
-FACE_SID
-¤â¤¦¤¹¤°¥¨¥ä¥Ê¥ó¥¹·Ï¤Ø¤Î¥ï¡¼¥×¤¬»Ï¤Þ¤ë¡£
-FACE_CHRIS
-¤½¤ÎÀ±·Ï¤Ë¤Ï¤¿¤¯¤µ¤ó¤ÎWEAPCO¤ÎÅÛÎ줬¤¤¤ë¤Î¤À¤í¤¦?
-FACE_SID
-¤½¤ÎÄ̤ê¤À¡£¤½¤³¤Ï¤³¤Î¶ä²Ï¤ÇºÇ¤â´í¸±¤Ê¾ì½ê¤Î1¤Ä¤À¡£
-FACE_CHRIS
-¤½¤³¤Ë¹Ô¤¯¤Î¤¬²¶¤¿¤Á¤Î¤¿¤á¤Ë¤Ê¤ë¤È?
-FACE_SID
-¤½¤¦¤À¡£»ä¤Ë·×²è¤¬¤¢¤ë¡£
-FACE_SID
-¤³¤³¤Ï´û¤Ë¥¹¥Ô¥ê¥Ã¥È·Ï¤Ç¤Ï¤Ê¤¤¡£°ÜÆ°Ãæ¤ËWEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤ËÁø¶ø¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤¤³¤È¤ò˺¤ì¤ë¤Ê¡£
-FACE_CHRIS
-¤½¤¤¤Ä¤Ï³Ú¤·¤ß¤À!
diff --git a/data/cutscene3.dat b/data/cutscene3.dat
deleted file mode 100644 (file)
index 53fb25d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-gfx/eyananth.jpg
--0.5 0
-
-0 0 300 300 0.5
-1 24 250 260 0.5
-2 20 250 360 0.5
-3 -1 0 0 0
-4 -1 0 0 0
-5 -1 0 0 0
-6 -1 0 0 0
-7 -1 0 0 0
-8 -1 0 0 0
-9 -1 0 0 0
-10 -1 0 0 0
-11 -1 0 0 0
-12 -1 0 0 0
-13 -1 0 0 0
-14 -1 0 0 0
-
-FACE_PHOEBE
-¤¤¤¤¥Ø¥Ã¥É¥®¥¢¤Í! ¤â¤·¤«¤·¤ÆƱ¤¸Å¹¤ÇÇã¤Ã¤¿¤ó¤¸¤ã¤Ê¤¤?
-FACE_CHRIS
-¤â¤Ã¤È½ÅÍפʤ³¤È¤¬¤¢¤ë¡£¤¢¤½¤³¤Ç²¿¤ò¤·¤Æ¤¿¤ó¤À? ²¶¤¬¶á¤¯¤Ë¤¤¤Æ¤è¤«¤Ã¤¿¤è!
-FACE_PHOEBE
-»Ð¤µ¤ó¤òõ¤·¤Æ¤¤¤¿¡£1½µ´ÖÁ°¤Ë¤¤¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¤Î¡£
-FACE_PHOEBE
-ÂԤäÆ! ¤¢¤Ê¤¿¤¿¤Á¥¹¥Ô¥ê¥Ã¥È·Ï¤«¤éÍ褿ȿÍ𷳤Ǥ·¤ç¤¦! ¤¹¤´¤¤¤ï! »ä¤â²Ã¤ï¤Ã¤Æ¤¤¤¤?
-FACE_CHRIS
-¿·¤¿¤ÊÀïÎϤ«? ²¶¤Ïº¤¤é¤Ê¤¤¤Ê! ¤É¤¦¤À¡¢¥·¥É?
-FACE_SID
-¤¤¤¤¤À¤í¤¦¡£¤½¤ÎͶƳ¥ß¥µ¥¤¥ë¤Ë¤â¶½Ì£¤¬¤¢¤ë¡£¤½¤ì¤Ï½õ¤±¤Ë¤Ê¤ê¤½¤¦¤À¡£
-FACE_CHRIS
-¤½¤¦¤¤¤¦¤ï¤±¤À¡£¤è¤¦¤³¤½!
-FACE_NONE
-°Ê¸å¤ÎºîÀï¤Ë¤Ï¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹¤¬²Ã¤ï¤ë¡£¤·¤«¤·¡¢Èà½÷¤¬»²²Ã¤·¤Ê¤¤ºîÀï¤â¤¢¤ë¡£
diff --git a/data/cutscene4.dat b/data/cutscene4.dat
deleted file mode 100644 (file)
index 0383242..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-gfx/eyananth.jpg
--1.4 0
-
-0 0 200 300 1.5
-1 24 150 260 1.5
-2 20 110 300 1.5
-3 -1 0 0 0
-4 -1 0 0 0
-5 -1 0 0 0
-6 -1 0 0 0
-7 -1 0 0 0
-8 -1 0 0 0
-9 -1 0 0 0
-10 -1 0 0 0
-11 -1 0 0 0
-12 -1 0 0 0
-13 -1 0 0 0
-14 -1 0 0 0
-
-FACE_SID
-²¿¤¬¤¢¤Ã¤¿¤ó¤À¡¢¥¯¥ê¥¹¡£±ÇÁü¤¬ÅÓÀ䤨¤Æ¤¤¤¿¡£
-FACE_CHRIS
-WEAPCO¤ÎºÎ·¡Á¥¤òÇ˲õ¤·¤¿¤¬¡¢¤½¤Îľ¸å¤Ë¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó¤È̾¾è¤ëÃˤ˲ñ¤Ã¤¿¡£
-FACE_SID
-ʹ¤¤¤¿¤³¤È¤¬¤¢¤ë¡£WEAPCO¤Î´ÏÂâ»ÊÎá´±¤Ç¡¢Èó¾ï¤Ëͭǽ¤Ê¥Ñ¥¤¥í¥Ã¥È¤À¡£
-FACE_CHRIS
-Åۤϲ¶¤òÃϹö¤ÎÍͤÊÀ襤¤Ë°ú¤­¤º¤ê¹þ¤ó¤À! ¤À¤¬¡¢Ä¹¤¯¤ÏÀï¤ï¤Ê¤«¤Ã¤¿¡£²¶¤ò»î¤·¤Æ¤¤¤¿¤À¤±¤«¤â¤·¤ì¤ó¡£
-FACE_CHRIS
-¤½¤ì¤è¤ê¥·¥É¡¢¥â¥ë¥É¡¼¥ë·Ï¤Î¾ðÊó¤Ï¤¢¤ë¤«?
-FACE_SID
-Êá¤é¤¨¤¿²Ê³Ø¼Ô¤Ë¤è¤ë¤È¡¢WEAPCO¤Ï¤½¤³¤Ç¿··¿ÀïÆ®µ¡¤Î»î¸³¤ò¤·¤Æ¤¤¤ë¤½¤¦¤À¡£
-FACE_CHRIS
-¤½¤¤¤Ä¤ò¤Ö¤Ã²õ¤·¤Æ¡¢³«È¯¤ò»ß¤á¤Ê¤±¤ì¤Ð¤é¤Ê¤ó¤Ê¡£
-FACE_SID
-¤½¤ÎÄ̤ê¤À¡£
-FACE_PHOEBE
-¤½¤³¤Ë»Ð¤µ¤ó¤¬¤¤¤ë¤Î¤«¤·¤é¡Ä
diff --git a/data/cutscene5.dat b/data/cutscene5.dat
deleted file mode 100644 (file)
index 91ef141..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-gfx/mordor.jpg
--0.5 0
-
-0 0 300 300 0.5
-1 24 250 260 0.5
-2 20 250 360 0.5
-3 -1 0 0 0
-4 -1 0 0 0
-5 -1 0 0 0
-6 -1 0 0 0
-7 -1 0 0 0
-8 -1 0 0 0
-9 -1 0 0 0
-10 -1 0 0 0
-11 -1 0 0 0
-12 -1 0 0 0
-13 -1 0 0 0
-14 -1 0 0 0
-
-FACE_PHOEBE
-»Ð¤µ¤ó¤Ï¤À¤¤¤¸¤ç¤¦¤Ö?
-FACE_SID
-²¿¤«¥¤¥ó¥×¥é¥ó¥È¤Î¤è¤¦¤Êʪ¤¬¤¢¤Ã¤¿¤¬¼è¤ê½ü¤±¤¿¡£¤Þ¤À¤·¤Ð¤é¤¯¤Î´Ö¤ÏƬÄˤ¬¤¹¤ë¤À¤í¤¦¡£
-FACE_CHRIS
-²¿¤«½ÅÍפʤ³¤È¤Ïʹ¤±¤½¤¦¤«?
-FACE_SID
-µ­²±¤¬Ìá¤ë¤Þ¤Ç¾¯¤·ÂÔ¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥¤¥ó¥×¥é¥ó¥È¤¬¤¢¤Ã¤¿¤È¤­¤Î¤³¤È¤Ï»×¤¤½Ð¤»¤Ê¤¤¤À¤í¤¦¡£
-FACE_SID
-¤½¤ì¤Ç¤â´Ï¤ÎÁà½Ä¤Ï¤Ç¤­¤½¤¦¤À¡£
-FACE_NONE
-¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹¤ÏÀïͧ¤È¤Ê¤Ã¤¿¡£¤·¤«¤·¡¢¥Õ¥§¡¼¥Ù¤ÈƱÍÍ¡¢°ìÉô¤ÎºîÀï¤Ë¤Ï»²²Ã¤Ç¤­¤Ê¤¤¡£
diff --git a/data/cutscene6.dat b/data/cutscene6.dat
deleted file mode 100644 (file)
index 15110ed..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-gfx/mordor.jpg
--1.4 0
-
-0 0 200 300 1.5
-1 24 150 260 1.5
-2 20 110 300 1.5
-3 20 150 360 1.5
-4 -1 0 0 0
-5 -1 0 0 0
-6 -1 0 0 0
-7 -1 0 0 0
-8 -1 0 0 0
-9 -1 0 0 0
-10 -1 0 0 0
-11 -1 0 0 0
-12 -1 0 0 0
-13 -1 0 0 0
-14 -1 0 0 0
-
-FACE_CHRIS
-¤¹¤Þ¤Ê¤¤¡£Àڤ껥¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£
-FACE_SID
-WEAPCO¤ËÂÇ·â¤òÍ¿¤¨¤¿¤Ê¤é¡¢¤É¤ó¤ÊÊýË¡¤Ç¤âÎɤ¤¡£
-FACE_SID
-ÂÀÍ۷ϤǤÎÀ襤¤Ï¡¢º¤Æñ¤Ê¤â¤Î¤Ë¤Ê¤ë¤À¤í¤¦¡£³°ÏÇÀ±¤Ë¶¯ÎϤÊËɸæ¤òÉߤ¤¤Æ¤¤¤ë¤Èʹ¤¤¤¿¡£
-FACE_PHOEBE
-¤Ê¤é¤Ð¡¢¤½¤³¤«¤é»Ï¤á¤Ê¤¤¤È¤Í¡£
-FACE_SID
-¤½¤³¤Ë¤¤¤ë·³ÃĤϺ£¤Þ¤Ç¤È¤ÏÁ´¤¯°Û¤Ê¤ë¤â¤Î¤À¡£³§¡¢µ¤¤ò¤Ä¤±¤í¡£
diff --git a/data/planets_eyananth.dat b/data/planets_eyananth.dat
deleted file mode 100644 (file)
index 7972f3f..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-15
-¥Í¥í¥É
-31
-30
-¥¢¥ì¥º
-32
-30
-¥¦¥ë¥½¥ë
-33
-20
-¥É¥ê¥à
-31
-40
-¥¨¥é¥á¡¼¥ë
-34
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
-
-7
-1
-FACE_PHOEBE
-??????????? (¥Í¥í¥É)
-SOS
-8
-2
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥¢¥ì¥º)
-°åÌôÉʤÎÍ¢Á÷Á¥¤Îµß½õ
-9
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥¦¥ë¥½¥ë)
-5ÀɤÎWEAPCOÊäµë´Ï¤òÙ½Êá
-10
-1
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥É¥ê¥à)
-WEAPCO¤Î²Ê³Ø¼Ô¤ÎÁܺ÷
-11
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥¨¥é¥á¡¼¥ë)
-WEAPCO¤ÎºÎ·¡Á¥¤ÎÇ˲õ
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
-6
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¤Ê¤·)
-ÅÛÎìÍ¢Á÷¤ÎÁË»ß
diff --git a/data/planets_mordor.dat b/data/planets_mordor.dat
deleted file mode 100644 (file)
index 26d1f8f..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-15
-¥ª¥Ç¥ª¥ó
-31
-30
-¥Õ¥§¥í¥ó
-32
-30
-¥µ¥¤¥Ù¥¸
-33
-20
-¥¢¥ë¥Þ¥µ
-31
-20
-¥Ý¥¹¥¤¥Ã¥¯
-34
-40
-¥¨¥ê¥Ã¥·¥å
-31
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
-
-13
-1
-FACE_PHOEBE
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹ (¥ª¥Ç¥ª¥ó)
-¥¦¡¼¥·¥å¥é¤È²ñ¤¦
-14
-2
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥Õ¥§¥í¥ó)
-È¿Í𷳤λٱç
-15
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥µ¥¤¥Ù¥¸)
-¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ç¤ÎºÎ·¡
-16
-1
-FACE_KRASS
-¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼ (¥¢¥ë¥Þ¥µ)
-Âå¶â¤ÎÍÑ°Õ
-17
-0
-FACE_URSULA
-¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹ (¥Ý¥¹¥¤¥Ã¥¯)
-WEAPCO¤Î½ÅÌò¤ÎÈÂÁ÷¤ÎÁË»ß
-18
-0
-FACE_PHOEBE
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹ (¥¨¥ê¥Ã¥·¥å)
-WEAPCO¤Î½ÅÌò¤ÎÄÉÀ×
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
-12
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¤Ê¤·)
-»îºîÀïÆ®µ¡¤ÎÇ˲õ
diff --git a/data/planets_sol.dat b/data/planets_sol.dat
deleted file mode 100644 (file)
index 1407688..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-15
-¿åÀ±
-33
-20
-¶âÀ±
-34
-20
-Ãϵå
-32
-20
-²ÐÀ±
-33
-30
-ÌÚÀ±
-34
-20
-ÅÚÀ±
-31
-20
-Å·²¦À±
-31
-20
-³¤²¦À±
-31
-20
-̽²¦À±
-31
--1
-NONE
-0
-
--1
--1
-NONE
-NONE
-NONE
-26
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¶âÀ±)
-Á´¤Æ¤ò½ª¤ï¤é¤»¤ë
-25
-0
-FACE_CHRIS
-Á´°÷ (Ãϵå)
-Ãϵå¤ÎÃ¥´Ô
-24
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (²ÐÀ±)
-ÆâÏÇÀ±Ëɱҥ·¥¹¥Æ¥à¤ÎÇ˲õ
-23
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (ÌÚÀ±)
-µßÆñ¿®¹æ¤ÎÄ´ºº
-22
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (ÅÚÀ±)
-³°ÏÇÀ±Ëɱҥ·¥¹¥Æ¥à¤ÎÇ˲õ
-21
-2
-FACE_URSULA
-¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹ (Å·²¦À±)
-Å·²¦À±¤ÎÀ©°µ
-20
-1
-FACE_PHOEBE
-¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹ (³¤²¦À±)
-³¤²¦À±¤ÎÀ©°µ
-19
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (̽²¦À±)
-̽²¦À±¤ÎÀ©°µ
--1
--1
-NONE
-NONE
-NONE
diff --git a/data/planets_spirit.dat b/data/planets_spirit.dat
deleted file mode 100644 (file)
index b1cc8ec..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-15
-¥Ï¥¤¥ë
-31
-30
-¥»¥é¥É¥»
-32
-30
-¥Ò¥ó¥¹¥¿¥°
-33
-20
-¥¸¥ç¥ë¥À¡¼
-31
-40
-¥â¥¨¥Ü
-34
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
--1
-NONE
-0
-
-1
-0
-FACE_KRASS
-¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼ (¥Ï¥¤¥ë)
-WEAPCO¤Î·±Îý½ê¤ÎÇ˲õ
-2
-1
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥»¥é¥É¥»)
-6¤Ä¤ÎÀѲ٤βó¼ý
-3
-2
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥Ò¥ó¥¹¥¿¥°)
-5ÀɤÎWEAPCO¥ß¥µ¥¤¥ëÄú¤ÎÇ˲õ
-4
-3
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥¸¥ç¥ë¥À¡¼)
-¥¸¥ç¥ë¥À¡¼¼þÊդε¡Íë¤Î½üµî
-5
-0
-FACE_SID
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó (¥â¥¨¥Ü)
-WEAPCO¥Õ¥ê¥²¡¼¥È¤ÎÇ˲õ
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
--1
--1
-NONE
-NONE
-NONE
-
diff --git a/data/resources_all.dat b/data/resources_all.dat
deleted file mode 100644 (file)
index c9442ff..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-0 gfx/plasmaGreen.png
-1 gfx/plasmaRed.png
-2 gfx/rocket1.png
-3 gfx/rocket2.png
-4 gfx/explode1.png
-5 gfx/explode2.png
-6 gfx/explode3.png
-7 gfx/explode4.png
-8 gfx/explode05.png
-9 gfx/explode06.png
-10 gfx/explode07.png
-11 gfx/explode08.png
-12 gfx/explode9.png
-13 gfx/explode10.png
-14 gfx/explode11.png
-15 gfx/explode12.png
-16 gfx/explode13.png
-17 gfx/explode14.png
-18 gfx/explode15.png
-19 gfx/explode16.png
-20 gfx/elec1.png
-21 gfx/elec2.png
-22 gfx/elec3.png
-23 gfx/elec4.png
-24 gfx/dollar.png
-25 gfx/rocket.png
-26 gfx/heart.png
-27 gfx/plasmaAmmo.png
-28 gfx/plasmaRate.png
-29 gfx/plasmaDamage.png
-30 gfx/chainLink.png
-31 gfx/mine.png
-32 gfx/cargo1.png
-33 gfx/greenDir.png
-34 gfx/redDir.png
-35 gfx/stunBolt.png
-36 gfx/arrowNorth.png
-37 gfx/arrowNorthEast.png
-38 gfx/arrowEast.png
-39 gfx/arrowSouthEast.png
-40 gfx/arrowSouth.png
-41 gfx/arrowSouthWest.png
-42 gfx/arrowWest.png
-43 gfx/arrowNorthWest.png
-44 gfx/targetText.png
-45 gfx/pod.png
-46 gfx/ore1.png
-47 gfx/ore2.png
-48 gfx/ore3.png
-49 gfx/rocketAmmo.png
-50 gfx/superCharge.png
-90 gfx/face_chris.png
-91 gfx/face_sid.png
-92 gfx/face_krass.png
-93 gfx/face_kline.png
-94 gfx/face_phoebe.png
-95 gfx/face_ursula.png
-96 gfx/face_crew.png
--1
diff --git a/data/resources_eyananth.dat b/data/resources_eyananth.dat
deleted file mode 100644 (file)
index 737aae3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-2 gfx/dualFighter1.png
-3 gfx/dualFighter2.png
-4 gfx/missileBoat1.png
-5 gfx/missileBoat2.png
-6 gfx/eliteFighter1.png
-7 gfx/eliteFighter2.png
-8 gfx/aimFighter1.png
-9 gfx/aimFighter2.png
-10 gfx/slaveTrans1.png
-11 gfx/slaveTrans2.png
-12 gfx/goodTrans1.png
-13 gfx/goodTrans2.png
-14 gfx/transport1.png
-15 gfx/transport2.png
-16 gfx/miner1.png
-17 gfx/miner2.png
-18 gfx/kline11.png
-19 gfx/kline12.png
-20 gfx/wingmate1.png
-21 gfx/wingmate2.png
-22 gfx/tug1.png
-23 gfx/tug2.png
-24 gfx/sid1.png
-25 gfx/sid2.png
-26 gfx/mineBoss1.png
-27 gfx/mineBoss2.png
-28 gfx/mineBossWing11.png
-29 gfx/mineBossWing12.png
-30 gfx/mineBossWing21.png
-31 gfx/mineBossWing22.png
-32 gfx/mineBossWing31.png
-33 gfx/mineBossWing32.png
-34 gfx/mineBossWing41.png
-35 gfx/mineBossWing42.png
-36 gfx/drone1.png
-37 gfx/drone2.png
-38 gfx/asteroid1.png
-39 gfx/asteroid2.png
-40 gfx/asteroid3.png
--1
diff --git a/data/resources_mordor.dat b/data/resources_mordor.dat
deleted file mode 100644 (file)
index e84bebe..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-2 gfx/dualFighter1.png
-3 gfx/dualFighter2.png
-4 gfx/missileBoat1.png
-5 gfx/missileBoat2.png
-6 gfx/eliteFighter1.png
-7 gfx/eliteFighter2.png
-8 gfx/aimFighter1.png
-9 gfx/aimFighter2.png
-10 gfx/cloakShip1.png
-11 gfx/cloakShip2.png
-12 gfx/evilUrsula1.png
-13 gfx/evilUrsula2.png
-14 gfx/transport1.png
-15 gfx/transport2.png
-16 gfx/miner1.png
-17 gfx/miner2.png
-18 gfx/kline11.png
-19 gfx/kline12.png
-20 gfx/wingmate1.png
-21 gfx/wingmate2.png
-22 gfx/tug1.png
-23 gfx/tug2.png
-24 gfx/sid1.png
-25 gfx/sid2.png
-26 gfx/merc1.png
-27 gfx/merc2.png
-28 gfx/execTrans1.png
-29 gfx/execTrans2.png
-30 gfx/escort1.png
-31 gfx/escort2.png
-32 gfx/rebelCarrier1.png
-33 gfx/rebelCarrier2.png
-34 gfx/drone1.png
-35 gfx/drone2.png
-36 gfx/drone1.png
-37 gfx/drone2.png
-38 gfx/asteroid1.png
-39 gfx/asteroid2.png
-40 gfx/asteroid3.png
-41 gfx/mineBoss1.png
-42 gfx/mineBoss2.png
-43 gfx/mineBossWing11.png
-44 gfx/mineBossWing12.png
-45 gfx/mineBossWing21.png
-46 gfx/mineBossWing22.png
-47 gfx/mineBossWing31.png
-48 gfx/mineBossWing32.png
-49 gfx/mineBossWing41.png
-50 gfx/mineBossWing42.png
-
--1
diff --git a/data/resources_sol.dat b/data/resources_sol.dat
deleted file mode 100644 (file)
index 8b361e4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-2 gfx/dualFighter1.png
-3 gfx/dualFighter2.png
-4 gfx/missileBoat1.png
-5 gfx/missileBoat2.png
-6 gfx/eliteFighter1.png
-7 gfx/eliteFighter2.png
-8 gfx/aimFighter1.png
-9 gfx/aimFighter2.png
-10 gfx/mobileCannon1.png
-11 gfx/mobileCannon2.png
-12 gfx/plutoBoss1.png
-13 gfx/plutoBoss2.png
-14 gfx/transport1.png
-15 gfx/transport2.png
-16 gfx/miner1.png
-17 gfx/miner2.png
-18 gfx/kline11.png
-19 gfx/kline12.png
-20 gfx/wingmate1.png
-21 gfx/wingmate2.png
-22 gfx/tug1.png
-23 gfx/tug2.png
-24 gfx/sid1.png
-25 gfx/sid2.png
-26 gfx/merc1.png
-27 gfx/merc2.png
-30 gfx/escort1.png
-31 gfx/escort2.png
-32 gfx/barrier.png
-33 gfx/barrier.png
-34 gfx/mobileShield1.png
-35 gfx/mobileShield2.png
-36 gfx/drone1.png
-37 gfx/drone2.png
-38 gfx/asteroid1.png
-39 gfx/asteroid2.png
-40 gfx/asteroid3.png
-41 gfx/splitBoss11.png
-42 gfx/splitBoss12.png
-43 gfx/splitBoss21.png
-44 gfx/splitBoss22.png
-45 gfx/splitBoss31.png
-46 gfx/splitBoss32.png
--1
diff --git a/data/resources_spirit.dat b/data/resources_spirit.dat
deleted file mode 100644 (file)
index ca1493b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-2 gfx/dualFighter1.png
-3 gfx/dualFighter2.png
-4 gfx/missileBoat1.png
-5 gfx/missileBoat2.png
-6 gfx/eliteFighter1.png
-7 gfx/eliteFighter2.png
-8 gfx/frigateBody1.png
-9 gfx/frigateBody2.png
-10 gfx/frigateGun11.png
-11 gfx/frigateGun12.png
-12 gfx/frigateGun21.png
-13 gfx/frigateGun22.png
-14 gfx/transport1.png
-15 gfx/transport2.png
-16 gfx/miner1.png
-17 gfx/miner2.png
-18 gfx/kline11.png
-19 gfx/kline12.png
-22 gfx/tug1.png
-23 gfx/tug2.png
-24 gfx/sid1.png
-25 gfx/sid2.png
--1
diff --git a/data/script11.txt b/data/script11.txt
deleted file mode 100644 (file)
index 8518e3c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-5
-FACE_PHOEBE
--1
-0
-²¿¤«¤¬¤ª¤«¤·¤¤¡Ä! ¤â¤Ã¤È¸î±Ò¤¬¤¤¤Æ¤â¤¤¤¤¤Ï¤º!
-
--8
-FACE_PHOEBE
--1
-0
-¥¯¥Ã! æ«¤è! Ìá¤Ã¤Æ¡¢¥¯¥ê¥¹¡¢¤½¤Î¾ì¤òÎ¥¤ì¤Æ!!
-
--9
--1
-16
-128
-@none@
-
--13
-FACE_SID
--1
-0
-¥¯¥ê¥¹¡¢¤É¤¦¤·¡Ä¤¿¡Ä¡Ä
-
--15
-FACE_KLINE
--1
-0
-¤Ä¤¤¤ËºÇ¤âÌñ²ð¤ÊÃˤ˲ñ¤¨¤¿!
-
--20
-FACE_CHRIS
--1
-0
-¥ï¡¼¥×¥É¥é¥¤¥Ö¤Î¤È¤­¤Îº®Àþ¤Ç¸«¤«¤±¤¿¤Ê¡£Ã¯¤À?
-
--25
-FACE_KLINE
--1
-0
-»ä¤Ï¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó¡£¤½¤·¤Æ¡¢¤½¤Î¾®¤µ¤Ê¥Ü¥íÁ¥¤ò»ß¤á¤ËÍ褿!
-
--31
-FACE_CHRIS
--1
-0
-¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó? ¥Õ¥ó¡¢¤º¤¤¤Ö¤ó¤È¼«¿®¤¬¤¢¤ë¤è¤¦¤À¤Ê¡£
-
--36
-FACE_KLINE
--1
-0
-ƨ¤²¤ë¾ì½ê¤â¤Ê¤¯¡¢±£¤ì¤ë¾ì½ê¤â¤Ê¤¯¡¢¤½¤·¤Æ½õ¤±¤â¤¤¤Ê¤¤! ¤É¤¦¤¹¤ë¤«³Ú¤·¤ß¤À¡Ä
-
--42
--1
-15
--20
-@none@
-
-0
diff --git a/data/script13.txt b/data/script13.txt
deleted file mode 100644 (file)
index 7a79d2a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-2
-FACE_URSULA
--1
-0
-½ê°ÉÔÌÀ¤Î´ÏÁ¥¤òȯ¸«¡£¤¿¤À¤Á¤ËÌÜɸ¤òÇ˲õ¤¹¤ë¡£
-
-8
-FACE_CHRIS
--1
-0
-»Ð¤µ¤ó¤âͶƳ¥ß¥µ¥¤¥ë¥é¥ó¥Á¥ã¡¼¤ò»ý¤Ã¤Æ¤¤¤ë¤è¤¦¤À! ¥Õ¥§¡¼¥Ù¡¢²¿¤«¥¢¥É¥Ð¥¤¥¹¤Ï¤¢¤ë¤«?
-
-14
-FACE_PHOEBE
--1
-0
-¤¬¤ó¤Ð¤Ã¤ÆÈò¤±¤ë¤·¤«¤Ê¤¤¤ï!
-
-180
-FACE_SID
--1
-0
-¥¯¥ê¥¹! ¥¦¡¼¥·¥å¥é¤¬Æ¨¤²¤è¤¦¤È¤·¤Æ¤¤¤ë¤¾!
-
-195
--1
-0
-14
-128
-
-0
diff --git a/data/script16.txt b/data/script16.txt
deleted file mode 100644 (file)
index 5dd0248..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-1
-FACE_CHRIS
--1
-0
-¤¤¤¤´Ï¤À!
-
-7
-FACE_KRASS
--1
-0
-¤½¤¦¤À¤í¤¦¡¢¾®ÁΡ£²¶¤¬ºî¤Ã¤¿¤ó¤À¤«¤é¤Ê!
-
-60
-FACE_KRASS
--1
-0
-¤ª¤Ã¤È¾®ÁΡ¢¸½¤ì¤ä¤¬¤Ã¤¿¤¾! ¤É¤¦¤â¤ªÁ°¤Î¥À¥Á¤É¤â¤Ï¤¦¤Þ¤¯¤¤¤Ã¤Æ¤Ê¤¤¤è¤¦¤À¤Ê!
-
-60
--1
-10
--1048576
-@none@
-
-90
--1
-11
--1048576
-@none@
-
-93
-FACE_KRASS
--1
-0
-¤³¤¤¤Ä¤é¤ò²¶¤Î¸å¤í¤Ë¶á¤Å¤±¤ë¤Ê¡£¤µ¤â¤Ê¤¤¤È¤â¤Ã¤È¹â¤¯¤Ä¤¯¤¾!!!
-
-120
--1
-12
--1048576
-@none@
-
-140
-FACE_PHOEBE
-16
--1048576
-¤Á¤ç¤Ã¤È!! ²¿¤·¤Æ¤ë¤Î?
-
-140
--1
-17
--1048576
-@none@
-
-150
-FACE_KRASS
-19
-128
-²¶¤Ï½½Ê¬¤Ë²Ô¤¤¤À¡£¤¸¤ã¤¢¤Ê¾®ÁÎ!
-
-0
diff --git a/data/script17.txt b/data/script17.txt
deleted file mode 100644 (file)
index 54464fd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-90
-¥·¥É¡¦¥¦¥£¥ë¥½¥ó
-14
-128
-¥¯¥½¥Ã! Æ¨¤²¤è¤¦¤È¤·¤Æ¤¤¤ë¤¾! »ß¤á¤Ê¤±¤ì¤Ð!
-
-
-0
diff --git a/data/script22.txt b/data/script22.txt
deleted file mode 100644 (file)
index eb586ec..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-45
-FACE_SID
--1
-0
-¥¯¥ê¥¹! Ê̤Î2µ¡¤Î¥ì¡¼¥¶¡¼Ë¤¤¬Îΰè¤Ë¶á¤Å¤¤¤Æ¤¤¤ë¤¾!
-
-45
--1
-11
--1048576
-@none@
-
-45
--1
-12
--1048576
-@none@
-
-90
-FACE_SID
--1
-0
-2µ¡ÅþÃ夷¤¿!
-
-90
--1
-13
--1048576
-@none@
-
-90
--1
-14
--1048576
-@none@
-
-0
diff --git a/data/script23.txt b/data/script23.txt
deleted file mode 100644 (file)
index 48d5b8a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-1
--1
-10
--1048576
-@none@
-
-2
-FACE_URSULA
--1
-0
-櫤À! ²¿¤È¤¤¤¦¤³¤È¤À! ¥¿¥¤¥é¡¼¤á!
-
-8
-FACE_KRASS
--1
-0
-²¶¤Ï¸Û¤ï¤ì¿Í¤À¡£²¿¤ò´üÂÔ¤·¤Æ¤¤¤ë¤ó¤À?! WEAPCO¤Ï¤ªÁ°¤é¤ÈƱ¤¸¤è¤¦¤Ë²¶¤ò¸Û¤Ã¤¿¤À¤±¤À¡£
-
-14
-FACE_CHRIS
--1
-0
-¤½¤¦¤À¤Ê¡£¤ªÁ°¤Ë²¿¤«´üÂÔ¤·¤¿²¶¤¬¥Ð¥«¤À¤Ã¤¿¤è¡£
-
-15
--1
-11
--1048576
-@none@
-
-20
-FACE_KRASS
--1
-0
-¤µ¤¢Á᤯¤¯¤¿¤Ð¤ì¡£¾®Àڼ꤬ÂԤäƤë¤ó¤À¡¢¾®ÁΡġ£
-
-25
-FACE_CHRIS
--1
-0
-²¶¤Ë¤â̾Á°¤¬¤¢¤ë¡£ÃΤé¤Í¤¨¤Î¤«?
-
-45
--1
-12
--1048576
-@none@
-
-45
--1
-13
--1048576
-@none@
-
-0
diff --git a/data/script25.txt b/data/script25.txt
deleted file mode 100644 (file)
index 795e56a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-2
-FACE_KLINE
--1
-0
-¤³¤ì¤Ç½ª¤ï¤ê¤À¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¤¿¤¤¤·¤¿°­±¿¤À¤Ã¤¿¤¬¡¢¤½¤ì¤â¤â¤¦¿Ô¤­²Ì¤Æ¤¿!
-
-8
-FACE_CHRIS
--1
-0
-¤½¤ÎÄ̤ê¤À! ¤³¤ì¤Þ¤Ç¤º¤Ã¤Èƨ¤²¤é¤ì¤Æ¤¿¤«¤é¤Ê!
-
-0
diff --git a/data/script26.txt b/data/script26.txt
deleted file mode 100644 (file)
index 6986848..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-2
-FACE_CHRIS
--1
-0
-WEAPCO¤Ï½ª¤ï¤Ã¤¿¡¢¥±¥¹¥é¥ó! ¤ªÁ°¤Ë¤Ïƨ¤²¤ë¾ì½ê¤â¡¢±£¤ì¤ë¾ì½ê¤â¡¢½õ¤±¤â¤Ê¤¤¡£
-
-8
-FACE_KLINE
--1
-0
-¤ªÁ°¤Ï»ä¤ò¸«¤¯¤Ó¤Ã¤Æ¤¤¤ë¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£
diff --git a/data/script5.txt b/data/script5.txt
deleted file mode 100644 (file)
index e5d2d15..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-2
-FACE_SID
--1
-0
-¤Þ¤º¥Õ¥ê¥²¡¼¥È¤ÎÉðÁõ¤òÇ˲õ¤·¤í¡£¤½¤ì¤¬½õ¤±¤Ë¤Ê¤ë!
-
-120
-FACE_SID
--1
-0
-¥¯¥ê¥¹¡¢µÞ¤²! ¥Õ¥ê¥²¡¼¥È¤Ï¤â¤¦¤¹¤°¼ÍÄøÆâ¤À!
-
-150
-FACE_SID
--1
-0
-¥Õ¥ê¥²¡¼¥È¤Ï¥«¥Î¥óˤ¤òÁõŶ¤·¤Æ¤¤¤ë!
-
-170
-FACE_SID
--1
-0
-¥¯¥ê¥¹¡¢Á᤯¤·¤í!!!
-
-180
--1
-14
-132
-@none@
-
-180
-FACE_SID
--1
-0
-²¿¤È¤¤¤¦¤³¤È¤À¡Ä
-
-0
diff --git a/data/script7.txt b/data/script7.txt
deleted file mode 100644 (file)
index 19c26d7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-2
-FACE_PHOEBE
--1
-0
-¤³¤Ã¤Á¤è! ¤³¤Î¥ï¥¤¥ä¡¼¤òÀÚ¤ì¤ÐÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤ë¤ï!
-
-0
diff --git a/data/script8.txt b/data/script8.txt
deleted file mode 100644 (file)
index e423e1e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-2
-FACE_CREW
--1
-0
-¿À¤Ë´¶¼Õ¤À! ¤¿¤Î¤à¡¢½õ¤±¤Æ¤¯¤ì! ¤â¤·¤³¤ÎÁ¥¤¬Ç˲õ¤µ¤ì¤¿¤é¡Ä
-
-6
-FACE_CHRIS
--1
-0
-¤É¤Î¤¯¤é¤¤³Ý¤«¤ê¤½¤¦¤À?
-
-10
-FACE_CREW
--1
-0
-¿ôʬ¤À!
-
-60
-FACE_CREW
-19
--16
-¤è¤·! Éð´ï¤Ï»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿! ¸å¤Ï¥¨¥ó¥¸¥ó¤À¡Ä
-
-80
-FACE_CREW
-19
-16
-¥¯¥½¥Ã! ¤Þ¤¿Éð´ï¤¬¥À¥á¤Ë¤Ê¤Ã¤¿! ¤É¤¦¤¹¤ê¤ã¤¤¤¤¤ó¤À?!
-
-100
-FACE_CREW
-19
-2048
-¥¯¥ê¥¹¡¢½õ¤±¤Æ¤¯¤ì!! Á´¥·¥¹¥Æ¥à¤¬¥À¥¦¥ó¤À! Á´°÷¥Ç¥Ã¥­¤ÇÆ°¤±¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë!
-
-120
-FACE_CREW
--1
-0
-¤â¤¦¾¯¤·¤À¡Ä
-
-140
-FACE_CREW
-19
--2048
-OK! ²óÉü¤·¤¿¡£¸å¤Ï¥¨¥ó¥¸¥ó¤ÎÌäÂ꤬ʬ¤«¤ì¤Ð¡Ä
-
-177
-FACE_CREW
--1
-0
-¥¨¥ó¥¸¥ó¤Î½¤Íý´°Î»! È¯¿Ê!
-
-180
--1
-19
-132
-@none@
-
-0
index 338e6f8..8792678 100644 (file)
Binary files a/docs/arrowNorthEast.png and b/docs/arrowNorthEast.png differ
index 3f074f5..4babf17 100644 (file)
Binary files a/docs/dollar.png and b/docs/dollar.png differ
index a5559a7..d733778 100644 (file)
Binary files a/docs/heart.png and b/docs/heart.png differ
index c6dfa16..f0fc520 100644 (file)
@@ -2,8 +2,8 @@
 
 <html>
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
-  <title>Starfighter \83Q\81[\83\80\90à\96¾\8f\91</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
+  <title>Starfighter ¥²¡¼¥àÀâÌÀ½ñ</title>
   <style type="text/css">
   a {color: #499FFF; text-decoration: none; font-family: helvetica;}
   a:hover {color: #499FFF; text-decoration: underline}
 
 <body>
   <center>
-    <img src="../gfx/sflogo.png" alt="Starfighter">
+    <img src="sflogo.png" alt="Starfighter">
 
-    <h1>\83Q\81[\83\80\90à\96¾\8f\91</h1>
+    <h1>¥²¡¼¥àÀâÌÀ½ñ</h1>
   </center>
 
-  <h2>\83\89\83C\83Z\83\93\83X</h2>
+  <h2>¥é¥¤¥»¥ó¥¹</h2>
 
   <pre>
 Project: Starfighter
 Copyright &copy; 2003 Parallel Realities
 Copyright &copy; 2012 Guus Sliepen, Astrid S. de Wijn and others
-Copyright &copy; 2015 Julian Marchant
+Copyright &copy; 2015, 2016 onpon4
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -44,338 +44,306 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 </pre>
 
-  <h2>\8f\89\82ß\82É</h2>
+  <h2>½é¤á¤Ë</h2>
 
-  <p>Project: Starfighter \82Í\8cÃ\93T\93I\82È2D\83V\83\85\81[\83e\83B\83\93\83O\83Q\81[\83\80\82Å\82 \82é\81B
-  \83Q\81[\83\80\82Ì\92\86\82Å\81A\82 \82È\82½\82Í\83N\83\8a\83X\82Æ\8cÄ\82Î\82ê\82é\94½\97\90\8cR\82Ì\83p\83C\83\8d\83b\83g\82É\82È\82è\81A\8cR\8eù\8aé\8bÆWEAPCO\82Æ\90í\82¤\82±\82Æ\82É\82È\82é\81B
-  WEAPCO\82Í\91S\89F\92\88\82ð\8f\88¬\82µ\81A\82»\82Ì\93S\8c\9d\82Å\8ex\94z\82µ\82Ä\82¢\82é\81B
-  \83N\83\8a\83X\82Í\82»\82Ì\89º\82Å\91½\82­\82Ì\90l\81X\82ª\8bê\82µ\82Ý\81A\8e\80\82ñ\82Å\82¢\82­\82Ì\82ð\96Ù\82Á\82Ä\8c©\82Ä\82Í\82¢\82ç\82ê\82È\82©\82Á\82½\81B
-  \94Þ\82Í\81w\83t\83@\83C\83A\83t\83\89\83C\81x\82Æ\8cÄ\82Î\82ê\82é\8dÅ\90V\89s\82Ì\89F\92\88\90í\93¬\8b@\82ð\92D\82¢\81A\90¯\8cn\82ð\89ð\95ú\82µ\82È\82ª\82ç\91¾\97z\8cn\82ð\96Ú\8ew\82·\90í\82¢\82ð\8en\82ß\82½\81B
-  \82±\82Ì\83Q\81[\83\80\82Í\83N\83\8a\83X\82ªWEAPCO\82Ì\83p\83g\83\8d\81[\83\8b\82©\82ç\93¦\82ê\82é\82Æ\82±\82ë\82©\82ç\8en\82Ü\82é\81B</p>
+  <p>Project: Starfighter ¤Ï¸ÅŵŪ¤Ê2D¥·¥å¡¼¥Æ¥£¥ó¥°¥²¡¼¥à¤Ç¤¢¤ë¡£
+  ¥²¡¼¥à¤ÎÃæ¤Ç¡¢¤¢¤Ê¤¿¤Ï¥¯¥ê¥¹¤È¸Æ¤Ð¤ì¤ëÈ¿Í𷳤Υѥ¤¥í¥Ã¥È¤Ë¤Ê¤ê¡¢·³¼û´ë¶ÈWEAPCO¤ÈÀ臘¤³¤È¤Ë¤Ê¤ë¡£
+  WEAPCO¤ÏÁ´±§Ãè¤ò¾¸°®¤·¡¢¤½¤ÎÅ´·ý¤Ç»ÙÇÛ¤·¤Æ¤¤¤ë¡£
+  ¥¯¥ê¥¹¤Ï¤½¤Î²¼¤Ç¿¤¯¤Î¿Í¡¹¤¬¶ì¤·¤ß¡¢»à¤ó¤Ç¤¤¤¯¤Î¤òÌۤäƸ«¤Æ¤Ï¤¤¤é¤ì¤Ê¤«¤Ã¤¿¡£
+  Èà¤Ï¡Ø¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¡Ù¤È¸Æ¤Ð¤ì¤ëºÇ¿·±Ô¤Î±§ÃèÀïÆ®µ¡¤òÃ¥¤¤¡¢À±·Ï¤ò²òÊü¤·¤Ê¤¬¤éÂÀÍ۷ϤòÌܻؤ¹À襤¤ò»Ï¤á¤¿¡£
+  ¤³¤Î¥²¡¼¥à¤Ï¥¯¥ê¥¹¤¬WEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤«¤éƨ¤ì¤ë¤È¤³¤í¤«¤é»Ï¤Þ¤ë¡£</p>
 
-  <h2>\91\80\8dì</h2>
+  <h2>Áàºî</h2>
 
-  <p>\83\81\83j\83\85\81[</p>
+  <p>¥á¥Ë¥å¡¼</p>
 
   <ul>
-  <li>\83J\81[\83\\83\8b\83L\81[ - \83I\83v\83V\83\87\83\93\82Ì\91I\91ð</li>
-  <li>CTRL/ENTER - \8c\88\92è</li>
+  <li>¥«¡¼¥½¥ë¥­¡¼ - ¥ª¥×¥·¥ç¥ó¤ÎÁªÂò</li>
+  <li>CTRL/ENTER - ·èÄê</li>
   </ul>
 
-  <p>\8dì\90í\8aÔ</p>
+  <p>ºîÀï´Ö</p>
 
   <ul>
-  <li>\83}\83E\83X\82Ü\82½\82Í\83J\81[\83\\83\8b\83L\81[ - \83J\81[\83\\83\8b\82ð\93®\82©\82·</li>
-  <li>\8d\83N\83\8a\83b\83N\82Ü\82½\82ÍCTRL/Enter - \8c\88\92è</li>
-  <li>\89E\83N\83\8a\83b\83N\82Ü\82½\82ÍSPACE - \98f\90¯\82Ì\8cö\93]\82ÌON/OFF</li>
+  <li>¥Þ¥¦¥¹¤Þ¤¿¤Ï¥«¡¼¥½¥ë¥­¡¼ - ¥«¡¼¥½¥ë¤òÆ°¤«¤¹</li>
+  <li>º¸¥¯¥ê¥Ã¥¯¤Þ¤¿¤ÏCTRL/Enter - ·èÄê</li>
+  <li>±¦¥¯¥ê¥Ã¥¯¤Þ¤¿¤ÏSPACE - ÏÇÀ±¤Î¸øž¤ÎON/OFF</li>
   </ul>
 
-  <p>\83Q\81[\83\80\92\86</p>
+  <p>¥²¡¼¥àÃæ</p>
 
   <ul>
-  <li>\83J\81[\83\\83\8b\83L\81[ - \83t\83@\83C\83A\83t\83\89\83C\82Ì\91\80\8dì</li>
-  <li>CTRL\82Ü\82½\82ÍZ - \8eå\91\95\94õ\82Ì\95\90\8aí\82Ì\94­\8eË</li>
-  <li>SPACE\82Ü\82½\82ÍX - \95\9b\91\95\94õ\82Ì\95\90\8aí\82Ì\94­\8eË</li>
-  <li>SHIFT - \8eå\91\95\94õ\82Ì\8fW\92\86/\8ag\8eU\82Ì\91I\91ð (\91\95\94õ\82Æ\8b­\89»\82ð\8eQ\8fÆ\82·\82é\82±\82Æ)</li>
-  <li>P - \83|\81[\83Y/\83|\81[\83Y\89ð\8f\9c</li>
-  <li>ESC - \90í\90ü\97£\92E (\8eå\97v\82È\94C\96±\82ð\8a®\97¹\82·\82é\82Ü\82Å\82Í\95s\89Â)</li>
-  <li>\83|\81[\83Y\92\86\82ÉESC - \8fI\97¹\82µ\83^\83C\83g\83\8b\82É\96ß\82é</li>
+  <li>¥«¡¼¥½¥ë¥­¡¼ - ¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ÎÁàºî</li>
+  <li>CTRL¤Þ¤¿¤ÏZ - ¼çÁõÈ÷¤ÎÉð´ï¤Îȯ¼Í</li>
+  <li>SPACE¤Þ¤¿¤ÏX - ÉûÁõÈ÷¤ÎÉð´ï¤Îȯ¼Í</li>
+  <li>SHIFT - ¼çÁõÈ÷¤Î½¸Ãæ/³È»¶¤ÎÁªÂò (ÁõÈ÷¤È¶¯²½¤ò»²¾È¤¹¤ë¤³¤È)</li>
+  <li>P - ¥Ý¡¼¥º/¥Ý¡¼¥º²ò½ü</li>
+  <li>ESC - ÀïÀþΥæ (¼çÍפÊǤ̳¤ò´°Î»¤¹¤ë¤Þ¤Ç¤ÏÉÔ²Ä)</li>
+  <li>¥Ý¡¼¥ºÃæ¤ËESC - ½ªÎ»¤·¥¿¥¤¥È¥ë¤ËÌá¤ë</li>
   </ul>
 
-  <p>\83W\83\87\83C\83X\83e\83B\83b\83N\82Æ\83Q\81[\83\80\83p\83b\83h</p>
+  <p>¥¸¥ç¥¤¥¹¥Æ¥£¥Ã¥¯¤È¥²¡¼¥à¥Ñ¥Ã¥É</p>
 
   <ul>
-  <li>\83X\83e\83B\83b\83N\82Ü\82½\82Í\83n\83b\83g - \83J\81[\83\\83\8b\83L\81[\82Æ\93¯\82</li>
-  <li>1 /  4\83{\83^\83\93 - \8eå\91\95\94õ\82Ì\95\90\8aí\82Ì\94­\8eË / \8c\88\92è</li>
-  <li>2 / 3 \83{\83^\83\93 - \95\9b\91\95\94õ\82Ì\95\90\8aí\82Ì\94­\8eË / \8c\88\92è</li>
-  <li>6 / 8 / 9 \83{\83^\83\93 - \8eå\91\95\94õ\82Ì\8fW\92\86/\8ag\8eU\82Ì\91I\91ð</li>
-  <li>10 \83{\83^\83\93 - \83|\81[\83Y/\83|\81[\83Y\89ð\8f\9c</li>
-  <li>5 / 7 \83{\83^\83\93 - \90í\90ü\97£\92E (\8eå\97v\82È\94C\96±\82ð\8a®\97¹\82·\82é\82Ü\82Å\82Í\95s\89Â)</li>
-  <li>\83|\81[\83Y\92\86\82É 5 / 7 \83{\83^\83\93 - \8fI\97¹\82µ\83^\83C\83g\83\8b\82É\96ß\82é</li>
+  <li>¥¹¥Æ¥£¥Ã¥¯¤Þ¤¿¤Ï¥Ï¥Ã¥È - ¥«¡¼¥½¥ë¥­¡¼¤ÈƱ¤¸</li>
+  <li>2 / 3 ¥Ü¥¿¥ó - ¼çÁõÈ÷¤ÎÉð´ï¤Îȯ¼Í / ·èÄê</li>
+  <li>1 / 4 ¥Ü¥¿¥ó - ÉûÁõÈ÷¤ÎÉð´ï¤Îȯ¼Í / ·èÄê</li>
+  <li>6 / 8 / 9 ¥Ü¥¿¥ó - ¼çÁõÈ÷¤Î½¸Ãæ/³È»¶¤ÎÁªÂò</li>
+  <li>10 ¥Ü¥¿¥ó - ¥Ý¡¼¥º/¥Ý¡¼¥º²ò½ü</li>
+  <li>5 / 7 ¥Ü¥¿¥ó - ÀïÀþΥæ (¼çÍפÊǤ̳¤ò´°Î»¤¹¤ë¤Þ¤Ç¤ÏÉÔ²Ä)</li>
+  <li>¥Ý¡¼¥ºÃæ¤Ë 5 / 7 ¥Ü¥¿¥ó - ½ªÎ»¤·¥¿¥¤¥È¥ë¤ËÌá¤ë</li>
   </ul>
 
-  <p>\92\8d\88Ó - \83L\81[\94z\92u\82Í\95Ï\82¦\82ç\82ê\82È\82¢</p>
+  <p>Ãí°Õ - ¥­¡¼ÇÛÃÖ¤ÏÊѤ¨¤é¤ì¤Ê¤¤</p>
 
-  <h2>How to Play</h2>
+  <h2>Í·¤ÓÊý</h2>
 
-  <p>Project: Starfighter\82ð\8bN\93®\82·\82é\82Æ\81A\83e\83L\83X\83g\82ª\83X\83N\83\8d\81[\83\8b\82·\82é\83v\83\8d\83\8d\81[\83O\82ª\8en\82Ü\82é\81B
-  \91Ò\82Â\82©\81ACTRL\82Ü\82½\82ÍSPACE\83L\81[\82ð\89\9f\82·\81B</p>
+  <p>Project: Starfighter¤òµ¯Æ°¤¹¤ë¤È¡¢¥Æ¥­¥¹¥È¤¬¥¹¥¯¥í¡¼¥ë¤¹¤ë¥×¥í¥í¡¼¥°¤¬»Ï¤Þ¤ë¡£
+  ÂԤĤ«¡¢CTRL¤Þ¤¿¤ÏSPACE¥­¡¼¤ò²¡¤¹¡£</p>
 
-  <p>\83^\83C\83g\83\8b\82Ì\95\\8e¦\82ª\8en\82Ü\82é\81B\83\81\83j\83\85\81[\82ª\95\\8e¦\82³\82ê\82é\82Æ(SPACE\82Ü\82½\82ÍCTRL\83L\81[\82Å\83^\83C\83g\83\8b\82ð\83X\83L\83b\83v\82Å\82«\82é)\81A\89º\82Ì\88ê\97\97\82©\82ç\91I\91ð\82·\82é\81B</p>
+  <p>¥¿¥¤¥È¥ë¤Îɽ¼¨¤¬»Ï¤Þ¤ë¡£¥á¥Ë¥å¡¼¤¬É½¼¨¤µ¤ì¤ë¤È(SPACE¤Þ¤¿¤ÏCTRL¥­¡¼¤Ç¥¿¥¤¥È¥ë¤ò¥¹¥­¥Ã¥×¤Ç¤­¤ë)¡¢²¼¤Î°ìÍ÷¤«¤éÁªÂò¤¹¤ë¡£</p>
 
   <ul class="menu">
-  <li>\8en\82ß\82©\82ç</li>
-  <li>\83\8d\81[\83h (*)</li>
-  <li>\91±\82« (*)</li>
-  <li>\83I\83v\83V\83\87\83\93</li>
-  <li>\8fI\97¹</li>
+  <li>ºÇ½é¤«¤é</li>
+  <li>¥í¡¼¥É</li>
+  <li>³¤­</li>
+  <li>¥ª¥×¥·¥ç¥ó</li>
+  <li>½ªÎ»</li>
   </ul>
 
-  <p><i>(*) \82Í\95Û\91\82³\82ê\82½\83Q\81[\83\80\82ª\82 \82é\8fê\8d\87\82Ì\82Ý\97L\8cø\82Å\82 \82é\81B</i></p>
-
   <dl>
-  <dt>\8en\82ß\82©\82ç</dt>
-  <dd>\83Q\81[\83\80\82ð\8dÅ\8f\89\82©\82ç\8en\82ß\82é\81B</dd>
-
-  <dt>\83\8d\81[\83h</dt>
-  <dd>\83\8d\81[\83h\82Å\82«\82é\83Q\81[\83\80\82ª\81A\95Û\91\82µ\82½\98f\90¯\96¼\82Æ\8b¤\82É\88ê\97\97\82Å\95\\8e¦\82³\82ê\82é\81B
-  \82±\82ê\82Í\81A\95Û\91\82³\82ê\82½\83Q\81[\83\80\82ª\8f­\82È\82­\82Æ\82à1\82Â\82 \82é\8fê\8d\87\82É\91I\91ð\82Å\82«\82é\81B</dd>
-
-  <dt>\91±\82«</dt>
-  <dd>\8e©\93®\93I\82É\95Û\91\82³\82ê\82½\8dÅ\90V\82Ì\83Q\81[\83\80\82ð\83\8d\81[\83h\82·\82é\81B
-  \8e©\93®\93I\82É\95Û\91\82³\82ê\82½\83Q\81[\83\80\82ª\82 \82é\8fê\8d\87\82Ì\82Ý\91I\91ð\82Å\82«\82é\81B</dd>
-
-  <dt>\83I\83v\83V\83\87\83\93</dt>
-  <dd>\83Q\81[\83\80\83I\83v\83V\83\87\83\93\82Ì\88ê\97\97\82ª\95\\8e¦\82³\82ê\82é\81B
-  \83I\83v\83V\83\87\83\93\82Å\82Í\81A\8cø\89Ê\89¹\81A\89¹\8ay\81A\8e©\93®\95Û\91\82Ì\83X\83\8d\83b\83g\82Ì\95Ï\8dX\82ª\82Å\82«\82é\81B
-  \89¹\8ay\82Æ\8cø\89Ê\89¹\82ÍON\81AOFF\82ð\90Ø\82è\91Ö\82¦\82ç\82ê\82é\81B
-  \8e©\93®\95Û\91\83X\83\8d\83b\83g\82Í\81A\83v\83\8c\83C\83\84\81[\82ª\8dì\90í\82ð\83N\83\8a\83A\82µ\82½\82Æ\82«\81A\8e©\93®\93I\82É\95Û\91\82·\82é\95Û\91\83X\83\8d\83b\83g\82ð1\81`5\82É\90Ø\82è\91Ö\82¦\82ç\82ê\82é\81B
-  \82±\82Ì\83I\83v\83V\83\87\83\93\82Å\94Ô\8d\86\82ð\91I\82Ô\82Æ\81A\8dì\90í\8fI\97¹\8e\9e\82É\82»\82Ì\94Ô\8d\86\82Ì\83X\83\8d\83b\83g\82ª\8eg\82í\82ê\82é\81B
-  \8aù\82É\8eg\82í\82ê\82Ä\82¢\82é\8fê\8d\87\82Å\82à\8fí\82É\8fã\8f\91\82«\82³\82ê\82é\82Ì\82Å\92\8d\88Ó\82·\82é\82±\82Æ\81B</dd>
-
-  <dt>\8fI\97¹</dt>
-  <dd>\83Q\81[\83\80\82ð\8fI\97¹\82·\82é\81B
-  \91I\91ð\82·\82é\82Æ\81A\8am\94F\82¹\82¸\82·\82®\82É\8fI\97¹\82·\82é(\83E\83B\83\93\83h\83E\82Ì\95Â\82\82é\83{\83^\83\93\82ð\83N\83\8a\83b\83N\82µ\82Ä\82à\81A\93¯\97l\82É\8fI\97¹\82Å\82«\82é)\81B</dd>
+  <dt>ºÇ½é¤«¤é</dt>
+  <dd>¿·¤·¤¯¥²¡¼¥à¤ò»Ï¤á¤ë¡£</dd>
+
+  <dt>¥í¡¼¥É</dt>
+  <dd>¥í¡¼¥É¤Ç¤­¤ë¥²¡¼¥à¤¬¡¢Êݸ¤·¤¿ÏÇÀ±Ì¾¤È¶¦¤Ë°ìÍ÷¤Çɽ¼¨¤µ¤ì¤ë¡£</dd>
+
+  <dt>³¤­</dt>
+  <dd>¼«Æ°Åª¤ËÊݸ¤µ¤ì¤¿ºÇ¿·¤Î¥²¡¼¥à¤ò¥í¡¼¥É¤¹¤ë¡£
+  ¼«Æ°Åª¤ËÊݸ¤µ¤ì¤¿¥²¡¼¥à¤¬¤¢¤ë¾ì¹ç¤Î¤ßÁªÂò¤Ç¤­¤ë¡£</dd>
+
+  <dt>¥ª¥×¥·¥ç¥ó</dt>
+  <dd>¥²¡¼¥à¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷¤¬É½¼¨¤µ¤ì¤ë¡£</dd>
+
+  <dt>½ªÎ»</dt>
+  <dd>¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¡£</dd>
   </dl>
 
-  <h2>\83Q\81[\83\80\82Ì\93Ç\8d\9e\82Æ\95Û\91¶</h2>
-
-  <p>\83Q\81[\83\80\82Í\83^\83C\83g\83\8b\82Å\83\8d\81[\83h\82Å\82«\82é\81B
-  \95Û\91\82³\82ê\82½\83Q\81[\83\80\82ª\82 \82ê\82Î\81A\81u\83\8d\81[\83h\81v\82Ì\91I\91ð\82ª\8c»\82ê\82é\81B
-  \82±\82ê\82ð\91I\91ð\82·\82é\82Æ\81A\83\8d\81[\83h\82Å\82«\82é\83Q\81[\83\80\82Ì\88ê\97\97\82ª\95\\8e¦\82³\82ê\82é\81B
-  \88ê\97\97\82©\82ç\91I\91ð\82µ\83\8d\81[\83h\82·\82é\82Æ\81A\8dì\90í\8aÔ\89æ\96Ê\82É\96ß\82é\81B
-  \82±\82Ì\89æ\96Ê\82É\96ß\82é\82½\82ß\82É\82Í\81A\81u\83^\83C\83g\83\8b\82É\96ß\82é\81v\82ð\91I\91ð\82·\82é\81B</p>
-
-  <p>\83Q\81[\83\80\82Ì\95Û\91\82É\82Í2\82Â\82Ì\95û\96@\82ª\82 \82é\81B
-  1\82Â\82Í\8dì\90í\8aÔ\89æ\96Ê\82Å\95Û\91\82·\82é\95û\96@\82Å\82 \82é\81B
-  \83J\81[\83\\83\8b\82ð\81u\95Û\91\81v\83A\83C\83R\83\93\82Ö\88Ú\93®\82³\82¹\91I\91ð\82·\82é\81B
-  \82·\82é\82Æ5\82Â\82Ì\95Û\91\83X\83\8d\83b\83g\82ª\8c»\82ê\82é\81B
-  \82±\82ê\82ç\82Ì\93à\82Ì1\82Â\82ð\91I\91ð\82µ\81A\81u\95Û\91\81v\83{\83^\83\93\82ð\89\9f\82·\82Æ\83Q\81[\83\80\82ª\95Û\91\82³\82ê\82é\81B
-  2\82Â\96Ú\82Í\81A\8e©\93®\93I\82É\95Û\91\82³\82ê\82é\8b@\94\\82Å\82 \82é\81B
-  \82±\82ê\82Í\81A\8dì\90í\82ð\8a®\97¹\82µ\82½\82Æ\82«\8e©\93®\93I\82É\83Q\81[\83\80\82ª\95Û\91\82³\82ê\82é\81B
-  \82±\82Ì\8b@\94\\82ð\8eg\82¤\82½\82ß\82É\82Í\81A\8e©\93®\93I\82É\95Û\91\82³\82ê\82é\83X\83\8d\83b\83g\82ð\82 \82ç\82©\82\82ß\91I\91ð\82·\82é\95K\97v\82ª\82 \82é\81B
-  \82»\82ê\82Í\83^\83C\83g\83\8b\83X\83N\83\8a\81[\83\93\82Ì\83I\83v\83V\83\87\83\93\81A\82Ü\82½\82Í\8dì\90í\8aÔ\82Ì\83I\83v\83V\83\87\83\93\82Å\90Ý\92è\82Å\82«\82é\81B</p>
-
-  <h2>\8dì\90í\82Ì\91I\91ð</h2>
-
-  <p>\82»\82ê\82¼\82ê\82Ì\98f\90¯\8cn\82Å\82Í\81A\8dì\90í\8aÔ\89æ\96Ê\82Ì\81u\92Ê\90M\81v\82Å\8dì\90í\82Ì\90à\96¾\82ð\8c©\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-  \82»\82±\82É\82Í\8ds\82¤\82×\82«\82±\82Æ\82Æ\81A\82Ç\82Ì\98f\90¯\82Å\8eÀ\8ds\82·\82é\82©\82Ì\8fî\95ñ\82ª\82 \82é\81B
-  \83v\83\8c\83C\83\84\81[\82ª\82»\82Ì\8dì\90í\82ð\8eÀ\8ds\82·\82é\82½\82ß\82É\82Í\81A\90¯\8cn\93à\82Ì\82»\82Ì\98f\90¯\82É\8ds\82­\95K\97v\82ª\82 \82é(\8fÚ\8d×\82Í\98f\90¯\8cn\93à\82Ì\88Ú\93®\82ð\8eQ\8fÆ\82·\82é\82±\82Æ)\81B
-  \82»\82Ì\98f\90¯\82É\8ds\82«\81A\81u\8e\9f\82Ì\8dì\90í\82ð\8aJ\8en\81v\82ð\83N\83\8a\83b\83N\82·\82é\82Æ\8dì\90í\8aT\97v\89æ\96Ê\82Ö\88Ú\8ds\82·\82é\81B
-  \81u\8e\9f\82Ì\8dì\90í\82ð\8aJ\8en\81v\83{\83^\83\93\82Í\81A\82»\82Ì\98f\90¯\82Å\82Ì\8dì\90í\82ð\8a®\97¹\82µ\82½\8fê\8d\87\82Í\95\\8e¦\82³\82ê\82È\82¢\81B</p>
-
-  <h2>\8dì\90í\82Ì\8aT\97v\82Ì\90à\96¾</h2>
-
-  <p>\8dì\90í\8eÀ\8ds\82Ì\91O\82É\8dì\90í\8aT\97v\89æ\96Ê\82ª\95\\8e¦\82³\82ê\82é\81B
-  \82±\82±\82Å\82Í\8dì\90í\82Ì\8eå\97v\82È\94C\96±\82Æ\81A(\91\8dÝ\82·\82ê\82Î)\95â\8f\95\93I\82È\94C\96±\82ª\95\\8e¦\82³\82ê\82é\81B
-  \8dì\90í\82Ì\90§\96ñ\82â\90§\8cÀ\8e\9e\8aÔ\82à\82±\82±\82Å\95\\8e¦\82³\82ê\82é\81B
-  \93Ç\82ñ\82¾\82È\82ç\82Î\81ACTRL\82Ü\82½\82ÍSPACE\83L\81[\82ð\89\9f\82·\82Æ\91±\82¯\82é\81B</p>
-
-  <h2>\8dì\90í\82Ì\90\8b\8ds</h2>
-
-  <p>\82±\82Ì\83Q\81[\83\80\82Ì\8dì\90í\82Å\82Í\81A1\82Â\82©\95¡\90\94\82Ì\94C\96±\82ð\90\8b\8ds\82µ\82æ\82¤\82Æ\82·\82é\82±\82Æ\82É\82È\82é\81B
-  \94C\96±\82É\82Í\8eå\97v\82È\82à\82Ì\82Æ\95â\8f\95\93I\82È\82à\82Ì\82ª\82 \82é\81B
-  \8dì\90í\82ð\8a®\97¹\82·\82é\82½\82ß\82É\82Í\81A\8eå\97v\82È\94C\96±\82ð\91S\82Ä\8a®\97¹\82·\82é\95K\97v\82ª\82 \82é\81B
-  \97á\82¦\82Î\81A\8dÅ\8f\89\82Ì\8dì\90í\82ÍWEAPCO\82Ì\83p\83g\83\8d\81[\83\8b\82©\82ç\93¦\82ê\82é\82±\82Æ\82Å\81A
-  \8eå\97v\82È\94C\96±\82Í\93G\82Ì\90í\93¬\8b@\82ð\91S\82Ä\94j\89ó\82·\82é\82±\82Æ\82Å\82 \82é\81B
-  \92B\90¬\82·\82é\82Æ\81A\83t\83@\83C\83A\83t\83\89\83C\82Í\82»\82Ì\8fê\82ð\97£\82ê\81A\8dì\90í\82Í\90¬\8c÷\82µ\82½\82±\82Æ\82É\82È\82é\81B</p>
-
-  <p>\88ê\95\94\82Ì\8dì\90í\82Å\82Í\81A\8eå\97v\82È\94C\96±\82Æ\95â\8f\95\93I\82È\94C\96±\82Ì2\82Â\82ª\82 \82é\82±\82Æ\82É\92\8d\88Ó\82·\82é\95K\97v\82ª\82 \82é\81B
-  \82±\82Ì\8fê\8d\87\81A\8eå\97v\82È\94C\96±\82ð\91S\82Ä\8a®\97¹\82µ\82Ä\82à\81A\95â\8f\95\93I\82È\94C\96±\82ª\8ec\82Á\82Ä\82¢\82é\8fê\8d\87\82Í\81A\83t\83@\83C\83A\83t\83\89\83C\82Í\82»\82Ì\8fê\82ð\97£\82ê\82È\82¢\81B
-  \83v\83\8c\83C\83\84\81[\82Í\95â\8f\95\93I\82È\94C\96±\82ð\8a®\97¹\82µ\82Ä\82à\81AESC\83L\81[\82ð\89\9f\82µ\82Ä\82»\82Ì\8fê\82ð\97£\82ê\82Ä\82à\82æ\82¢\81B
-  \95â\8f\95\93I\82È\94C\96±\82Í\94C\88Ó\82Å\82 \82é\81B</p>
-
-  <p>\8dì\90í\82Ì\8aÔ\81A\89æ\96Ê\82Ì\89º\82Ì\82Ù\82¤\82É\83\81\83b\83Z\81[\83W\82ª\8c»\82ê\82é\8fê\8d\87\82ª\82 \82é\81B
-  \82±\82ê\82ç\82Ì\83\81\83b\83Z\81[\83W\82Í\81A\8al\93¾\82µ\82½\83A\83C\83e\83\80\82â\8dì\90í\82Ì\8fî\95ñ\82ð\95\\82µ\82Ä\82¢\82é\81B
-  </p>
+  <h2>¥²¡¼¥à¤ÎÆɹþ¤ÈÊݸ</h2>
 
-  <ul>
-  <li><font color="#FFFFFF">\94\92\90F\82Ì\83\81\83b\83Z\81[\83W</font> - \83L\83\83\83b\83V\83\85\82â\83p\83\8f\81[\83A\83b\83v\93\99\82Ì\92Ê\8fí\82Ì\83A\83C\83e\83\80\82ð\8al\93¾\82µ\82½</li>
-  <li><font color="#00FF00">\97Î\90F\82Ì\83\81\83b\83Z\81[\83W</font> - \94C\96±\82ð\8a®\97¹\82µ\82½</li>
-  <li><font color="#00FFFF">\96¾\82é\82¢\90Â\90F\82Ì\83\81\83b\83Z\81[\83W</font> - \8eå\97v\82È\94C\96±\82Ì\8fÚ\8d×</li>
-  <li><font color="#FF0000">\90Ô\90F\82Ì\83\81\83b\83Z\81[\83W</font> - \8dì\90í\82É\8e¸\94s\82µ\82½\81A\8cx\8d\90\81A\92\87\8aÔ\82ª\90í\90ü\97£\92E\82µ\82½</li>
-  <li><font color="#FFFF00">\89©\90F\82¢\83\81\83b\83Z\81[\83W</font> - \95â\8f\95\93I\82È\94C\96±\82Ì\8fÚ\8d×</li>
-  </ul>
+  <p>¥²¡¼¥à¤Ï¥¿¥¤¥È¥ë¤Ç¥í¡¼¥É¤Ç¤­¤ë¡£</p>
+
+  <p>¥²¡¼¥à¤ÏºîÀï´Ö²èÌ̤ÇÊݸ¤Ç¤­¤ë¡£
+  ¥«¡¼¥½¥ë¤ò¡ÖÊݸ¡×¥¢¥¤¥³¥ó¤Ø°ÜÆ°¤µ¤»ÁªÂò¤¹¤ë¡£
+  ¤¹¤ë¤È5¤Ä¤ÎÊݸ¥¹¥í¥Ã¥È¤¬¸½¤ì¤ë¡£
+  ¤³¤ì¤é¤ÎÆâ¤Î1¤Ä¤òÁªÂò¤·¡¢¡ÖÊݸ¡×¥Ü¥¿¥ó¤ò²¡¤¹¤È¥²¡¼¥à¤¬Êݸ¤µ¤ì¤ë¡£</p>
+
+  <p>¸½ºß¤Î¥²¡¼¥à¾õÂ֤ϥª¡¼¥È¥»¡¼¥Ö¥¹¥í¥Ã¥È¤Ë¤â¼«Æ°Åª¤ËÊݸ¤µ¤ì¤ë¡£</p>
 
-  <h2>\83^\81[\83Q\83b\83g\82Ì\96î\88ó</h2>
+  <h2>ºîÀï¤ÎÁªÂò</h2>
 
-  <p><img src="../gfx/arrowNorthEast.png" align="left" alt="Target Arrow">
-  \96î\88ó\82Í\93G\82Ì\88Ê\92u\82ð\8e¦\82·\82à\82Ì\82Å\81A\83v\83\8c\83C\83\84\81[\82É\93G\82Ì\8aÍ\82Ì\95û\8cü\82ð\92m\82ç\82¹\82Ä\82¢\82é\81B
-  \96î\88ó\82ÍT\83L\81[\82ð\89\9f\82·\82±\82Æ\82Å3\82Â\82Ì\83\82\81[\83h(\83I\83t\81A\83~\83b\83V\83\87\83\93\83^\81[\83Q\83b\83g\82Ì\82Ý\81A\91S\82Ä\82 \82è)\82ð\91I\91ð\82Å\82«\82é\81B
-  \96î\88ó\82Í\91\8dÝ\82·\82é\91S\82Ä\82Ì\93G\82ð\94j\89ó\82µ\82È\82¯\82ê\82Î\82È\82ç\82È\82¢\8dì\90í\82Å\82Í\93Á\82É\97L\97p\82Å\82 \82é\81B
-  \92P\8f\83\82É\96î\88ó\82ð\92Ç\82¦\82Î\93G\82ð\8c©\82Â\82¯\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-  \96î\88ó\82Í\96Ú\95W\82ª\82·\82®\8bß\82­\82É\82¢\82é\8fê\8d\87\82Í\95\\8e¦\82³\82ê\82È\82¢\81B
-  \88ê\95\94\82Ì\8dì\90í(\83{\83X\82È\82Ç)\82Å\82Í\81A\83~\83b\83V\83\87\83\93\83^\81[\83Q\83b\83g\82Ì\96î\88ó\82ª\8dì\90í\82Ì\96Ú\95W\82ð\8ew\82µ\82Ä\82¢\82é\81B
-  \82»\82Ì\8fê\8d\87\81A\83^\81[\83Q\83b\83g\82Ì\83V\81[\83\8b\83h\82Ì\8ec\82è\82à\89æ\96Ê\82Ì\89E\89º\82É\95\\8e¦\82³\82ê\82é\81B</p>
+  <p>¤½¤ì¤¾¤ì¤ÎÏÇÀ±·Ï¤Ç¤Ï¡¢ºîÀï´Ö²èÌ̤ΡֺîÀï¡×¤ÇºîÀï¤ÎÀâÌÀ¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+  ¤½¤³¤Ë¤Ï¹Ô¤¦¤Ù¤­¤³¤È¤È¡¢¤É¤ÎÏÇÀ±¤Ç¼Â¹Ô¤¹¤ë¤«¤Î¾ðÊ󤬤¢¤ë¡£
+  ¥×¥ì¥¤¥ä¡¼¤¬¤½¤ÎºîÀï¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤Ï¡¢À±·ÏÆâ¤Î¤½¤ÎÏÇÀ±¤Ë¹Ô¤¯É¬Íפ¬¤¢¤ë(¾ÜºÙ¤ÏÏÇÀ±·ÏÆâ¤Î°ÜÆ°¤ò»²¾È¤¹¤ë¤³¤È)¡£
+  ¤½¤ÎÏÇÀ±¤Ë¹Ô¤­¡¢¡Ö¼¡¤ÎºîÀï¤ò³«»Ï¡×¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈºîÀï³µÍײèÌ̤ذܹԤ¹¤ë¡£
+  ¡Ö¼¡¤ÎºîÀï¤ò³«»Ï¡×¥Ü¥¿¥ó¤Ï¡¢¤½¤ÎÏÇÀ±¤Ç¤ÎºîÀï¤ò´°Î»¤·¤¿¾ì¹ç¤Ïɽ¼¨¤µ¤ì¤Ê¤¤¡£</p>
 
-  <h2>\98f\90¯\8cn\93à\82Ì\88Ú\93®</h2>
+  <h2>ºîÀï¤Î³µÍפÎÀâÌÀ</h2>
 
-  <p>\8dì\90í\82ð\8eÀ\8ds\82·\82é\82½\82ß\82É\82Í\81A\82»\82Ì\98f\90¯\82É\88Ú\93®\82·\82é\95K\97v\82ª\82 \82é\81B
-  \98f\90¯\82ð\91I\91ð\82·\82é\82½\82ß\82É\82Í\81A\8dì\90í\8aÔ\89æ\96Ê\82Ì\81u\90¯\8cn\83}\83b\83v\81v\82Å\98f\90¯\8cn\82ð\95\\8e¦\82µ\81A\98f\90¯\82ð\83N\83\8a\83b\83N\82·\82é\95K\97v\82ª\82 \82é\81B
-  \98f\90¯\8aÔ\82Ì\88Ú\93®\82Í\8aë\8c¯\82È\8fê\8d\87\82ª\82 \82é\81B
-  \82µ\82©\82µ\81A\8dK\82¢\82È\82±\82Æ\82É\81A\83X\83s\83\8a\83b\83g\8cn\82Í\88À\91S\82Å\81A\8c}\8c\82\82É\82 \82¤\8aë\8c¯\90«\82Í\82È\82¢\81B
-  \82»\82Ì\82½\82ß\91I\91ð\82·\82é\82Æ\82·\82®\82É\88Ú\93®\82ª\8a®\97¹\82·\82é\81B</p>
+  <p>ºîÀï¼Â¹Ô¤ÎÁ°¤ËºîÀï³µÍײèÌ̤¬É½¼¨¤µ¤ì¤ë¡£
+  ¤³¤³¤Ç¤ÏºîÀï¤Î¼çÍפÊǤ̳¤È¡¢(¸ºß¤¹¤ì¤Ð)Êä½õŪ¤ÊǤ̳¤¬É½¼¨¤µ¤ì¤ë¡£
+  ºîÀï¤ÎÀ©Ìó¤äÀ©¸Â»þ´Ö¤â¤³¤³¤Çɽ¼¨¤µ¤ì¤ë¡£
+  Æɤó¤À¤Ê¤é¤Ð¡¢CTRL¤Þ¤¿¤ÏSPACE¥­¡¼¤ò²¡¤¹¤È³¤±¤ë¡£</p>
 
-  <p>\91¼\82Ì\98f\90¯\8cn\82Å\82Í\81A\96Ú\93I\82É\8cü\82©\82Á\82Ä\88Ú\93®\82·\82é\93r\92\86\82ÅWEAPCO\82Ì\83p\83g\83\8d\81[\83\8b\82Æ\91\98\8bö\82·\82é\8aë\8c¯\90«\82ª\82 \82é\81B
-  \83X\83s\83\8a\83b\83g\8cn\82Ì\8cã\82Å\82Í\81A\82Ü\82¸\83v\83\8c\83C\83\84\81[\82Í\98f\90¯\82ð\83}\83E\83X\82Å\83N\83\8a\83b\83N\82·\82é\81B
-  \82·\82é\82Æ\81A\89æ\96Ê\82Ì\89E\89º\82Ì\81u\96Ú\93I\92n\81v\82É\98f\90¯\82Ì\96¼\91O\82ª\95\\8e¦\82³\82ê\82é\81B
-  \82»\82µ\82Ä\81A\81u\96Ú\93I\82Ì\98f\90¯\82Ö\8cü\82©\82¤\81v\83A\83C\83R\83\93\82ª\8c»\82ê\82é\82Ì\82Å\81A\82»\82ê\82ð\83N\83\8a\83b\83N\82·\82é\82Æ\83v\83\8c\83C\83\84\81[\82Í\96Ú\93I\92n\82Ì\98f\90¯\82Ö\82Ì\88Ú\93®\82ð\8en\82ß\82é\81B</p>
+  <h2>ºîÀï¤Î¿ë¹Ô</h2>
 
-  <p>\95Ê\82Ì\98f\90¯\82Ö\82Ì\88Ú\93®\82Í\81A\89æ\96Ê\82Ì\89º\82Ì2\82Â\82Ì\98f\90¯\82Å\8c»\82³\82ê\82é(\95Ð\95û\82ª\88Ú\93®\89º\82Å\81A\82à\82¤\95Ð\95û\82ª\88Ú\93®\90æ\82Å\82 \82é)\81B
-  \90Ô\82¢\91Ñ\82ª\88Ú\93®\82Ì\90i\92»\82ð\95\\82µ\82Ä\82¢\82é\81B
-  \90i\8ds\82Ì\91¬\82³\82Í2\82Â\82Ì\98f\90¯\8aÔ\82Ì\8b\97\97£\82É\82æ\82Á\82Ä\88Ù\82È\82é\81B
-  \82±\82Ì\8aÔ\81A\93G\82Æ\91\98\8bö\82·\82é\82±\82Æ\82ª\82 \82é(\91\98\8bö\82ð\8eQ\8fÆ\82·\82é\82±\82Æ)\81B
-  \90Ô\82¢\91Ñ\82ª\8a®\91S\82É\92B\82·\82é\82Æ\81A\88Ú\93®\82ª\8a®\97¹\82µ\96Ú\93I\82Ì\98f\90¯\82É\93\9e\92\85\82·\82é\81B</p>
+  <p>¤³¤Î¥²¡¼¥à¤ÎºîÀï¤Ç¤Ï¡¢1¤Ä¤«Ê£¿ô¤ÎǤ̳¤ò¿ë¹Ô¤·¤è¤¦¤È¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
+  Ç¤Ì³¤Ë¤Ï¼çÍפʤâ¤Î¤ÈÊä½õŪ¤Ê¤â¤Î¤¬¤¢¤ë¡£
+  ºîÀï¤ò´°Î»¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¼çÍפÊǤ̳¤òÁ´¤Æ´°Î»¤¹¤ëɬÍפ¬¤¢¤ë¡£
+  Î㤨¤Ð¡¢ºÇ½é¤ÎºîÀï¤ÏWEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤«¤éƨ¤ì¤ë¤³¤È¤Ç¡¢
+  ¼çÍפÊǤ̳¤ÏŨ¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£
+  Ã£À®¤¹¤ë¤È¡¢¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Ï¤½¤Î¾ì¤òÎ¥¤ì¡¢ºîÀï¤ÏÀ®¸ù¤·¤¿¤³¤È¤Ë¤Ê¤ë¡£</p>
 
-  <h2>\91\98\8bö</h2>
+  <p>°ìÉô¤ÎºîÀï¤Ç¤Ï¡¢¼çÍפÊǤ̳¤ÈÊä½õŪ¤ÊǤ̳¤Î2¤Ä¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ë¡£
+  ¤³¤Î¾ì¹ç¡¢¼çÍפÊǤ̳¤òÁ´¤Æ´°Î»¤·¤Æ¤â¡¢Êä½õŪ¤ÊǤ̳¤¬»Ä¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Ï¤½¤Î¾ì¤òÎ¥¤ì¤Ê¤¤¡£
+  ¥×¥ì¥¤¥ä¡¼¤ÏÊä½õŪ¤ÊǤ̳¤ò´°Î»¤·¤Æ¤â¡¢ESC¥­¡¼¤ò²¡¤·¤Æ¤½¤Î¾ì¤òÎ¥¤ì¤Æ¤â¤è¤¤¡£
+  Êä½õŪ¤ÊǤ̳¤ÏǤ°Õ¤Ç¤¢¤ë¡£</p>
 
-  <p>\98f\90¯\8cn\93à\82Ì2\82Â\82Ì\98f\90¯\82Ì\8aÔ\82ð\88Ú\93®\82·\82é\8aÔ\81A\93G\82Æ\91\98\8bö\82·\82é\82±\82Æ\82ª\82 \82é\81B
-  \82»\82Ì\8fê\8d\87\81A\8dì\90í\8eÀ\8ds\82Æ\93¯\82\82æ\82¤\82È\8fó\8bµ\82É\82È\82é\81B
-  \94C\96±\82Í\8dU\8c\82\82µ\82Ä\82­\82é\8c}\8c\82\8b@\82ð\91S\82Ä\94r\8f\9c\82·\82é\82±\82Æ\82Å\82 \82é\81B
-  \82»\82ê\82ª\8a®\97¹\82·\82é\82Æ\81A\83v\83\8c\83C\83\84\81[\82Í\8e©\97R\82É\82È\82è\82»\82Ì\8fê\82ð\97£\82ê\82é\81B</p>
+  <p>ºîÀï¤Î´Ö¡¢²èÌ̤β¼¤Î¤Û¤¦¤Ë¥á¥Ã¥»¡¼¥¸¤¬¸½¤ì¤ë¾ì¹ç¤¬¤¢¤ë¡£
+  ¤³¤ì¤é¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢³ÍÆÀ¤·¤¿¥¢¥¤¥Æ¥à¤äºîÀï¤Î¾ðÊó¤òɽ¤·¤Æ¤¤¤ë¡£
+  </p>
+
+  <ul>
+  <li><font color="#FFFFFF">Çò¿§¤Î¥á¥Ã¥»¡¼¥¸</font> - ¥­¥ã¥Ã¥·¥å¤ä¥Ñ¥ï¡¼¥¢¥Ã¥×Åù¤ÎÄ̾ï¤Î¥¢¥¤¥Æ¥à¤ò³ÍÆÀ¤·¤¿</li>
+  <li><font color="#00FF00">Îп§¤Î¥á¥Ã¥»¡¼¥¸</font> - Ç¤Ì³¤ò´°Î»¤·¤¿</li>
+  <li><font color="#00FFFF">ÌÀ¤ë¤¤ÀÄ¿§¤Î¥á¥Ã¥»¡¼¥¸</font> - ¼çÍפÊǤ̳¤Î¾ÜºÙ</li>
+  <li><font color="#FF0000">ÀÖ¿§¤Î¥á¥Ã¥»¡¼¥¸</font> - ºîÀï¤Ë¼ºÇÔ¤·¤¿¡¢·Ù¹ð¡¢Ãç´Ö¤¬ÀïÀþΥ椷¤¿</li>
+  <li><font color="#FFFF00">²«¿§¤¤¥á¥Ã¥»¡¼¥¸</font> - Êä½õŪ¤ÊǤ̳¤Î¾ÜºÙ</li>
+  </ul>
+
+  <h2>ÏÇÀ±·ÏÆâ¤Î°ÜÆ°</h2>
 
-  <p>\93G\82Æ\82Ì\91\98\8bö\82É\82Í\95Ê\82Ì\96Ú\93I\82ª\82 \82é\8fê\8d\87\82à\82 \82é - WEAPCO\83p\83g\83\8d\81[\83\8b\82ª\93z\97ê\82ð\94À\91\97\82µ\82Ä\82¢\82é\8fê\8d\87\82È\82Ç\82Å\82 \82é\81B
-  \82»\82Ì\8fê\8d\87\81A\94C\96±\82Ì1\82Â\82Í\88ê\92è\90\94\82Ì\93z\97ê\82ð\8b~\8fo\82·\82é\82±\82Æ\82É\82È\82é\81B
-  \82±\82ê\82Í\91\98\8bö\82µ\82½\8fê\8d\87\82Ì\82Ý\89Â\94\\82Å\82 \82é\81B</p>
+  <p>ºîÀï¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤½¤ÎÏÇÀ±¤Ë°ÜÆ°¤¹¤ëɬÍפ¬¤¢¤ë¡£
+  ÏÇÀ±¤òÁªÂò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤Þ¤º¥×¥ì¥¤¥ä¡¼¤ÏÏÇÀ±¤ò¥Þ¥¦¥¹¤Ç¥¯¥ê¥Ã¥¯¤¹¤ë¡£
+  ¤¹¤ë¤È¡¢²èÌ̤ᦲ¼¤Î¡ÖÌÜŪÃϡפËÏÇÀ±¤Î̾Á°¤¬É½¼¨¤µ¤ì¤ë¡£
+  ¤½¤·¤Æ¡¢¡ÖÌÜŪ¤ÎÏÇÀ±¤Ø¸þ¤«¤¦¡×¥¢¥¤¥³¥ó¤¬¸½¤ì¤ë¤Î¤Ç¡¢¤½¤ì¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥×¥ì¥¤¥ä¡¼¤ÏÌÜŪÃϤÎÏÇÀ±¤Ø¤Î°ÜÆ°¤ò»Ï¤á¤ë¡£</p>
 
-  <p>\8ao\82¦\82Ä\82¨\82­\82×\82«\8fd\97v\82È\82±\82Æ\82Ì1\82Â\82Í\81A\93G\82Æ\91\98\8bö\82µ\82Ä\8eó\82¯\82½\83_\83\81\81[\83W\82Í\96Ú\93I\82Ì\98f\90¯\82É\93\9e\92B\82·\82é\82Ü\82Å\89ñ\95\9c\82µ\82È\82¢\82Æ\82¢\82¤\82±\82Æ\82Å\82 \82é\81B
-  \82à\82µ\83v\83\8c\83C\83\84\81[\82ª\93G\82Æ\91\98\8bö\82µ\82Ä\91å\83_\83\81\81[\83W\82ð\8eó\82¯\82½\8fê\8d\87\82Å\82à\81A\8dÄ\82Ñ\93G\82Ì\8dU\8c\82\82É\82 \82¤\82±\82Æ\82ª\82 \82é\81B
-  \82±\82ê\82Í\82Æ\82Ä\82à\8aë\8c¯\82È\8fó\8bµ\82Å\82 \82é\81B</p>
+  <p>Ê̤ÎÏÇÀ±¤Ø¤Î°ÜÆ°¤Ï¡¢²èÌ̤β¼¤Î2¤Ä¤ÎÏÇÀ±¤Ç¸½¤µ¤ì¤ë(ÊÒÊý¤¬°ÜÆ°²¼¤Ç¡¢¤â¤¦ÊÒÊý¤¬°ÜÆ°Àè¤Ç¤¢¤ë)¡£
+  ÀÖ¤¤ÂÓ¤¬°ÜÆ°¤Î¿ÊĽ¤òɽ¤·¤Æ¤¤¤ë¡£
+  ¿Ê¹Ô¤Î®¤µ¤Ï2¤Ä¤ÎÏÇÀ±´Ö¤Îµ÷Î¥¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
+  ¤³¤Î´Ö¡¢Å¨¤ÈÁø¶ø¤¹¤ë¤³¤È¤¬¤¢¤ë(Áø¶ø¤ò»²¾È¤¹¤ë¤³¤È)¡£
+  ÀÖ¤¤ÂÓ¤¬´°Á´¤Ë㤹¤ë¤È¡¢°ÜÆ°¤¬´°Î»¤·ÌÜŪ¤ÎÏÇÀ±¤ËÅþÃ夹¤ë¡£</p>
 
-  <h2>\91\95\94õ\82Æ\8b­\89»</h2>
+  <h2>Áø¶ø</h2>
 
-  <p>\83Q\81[\83\80\82Ì\93r\92\86\82Å\8bà(\83L\83\83\83b\83V\83\85)\82ð\93¾\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-  \8bà\82Í\94j\89ó\82³\82ê\82½\93G\82Ì\8aÍ\91D\82©\82ç\93¾\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-  (\98f\90¯\8aÔ\82Å\91\98\8bö\82µ\82½\93G\82©\82ç\82Í\8bà\82ð\93¾\82ç\82ê\82È\82¢\82Ì\82Å\92\8d\88Ó\82·\82é\82±\82Æ\81B)</p>
+  <p>ÏÇÀ±·ÏÆâ¤Î2¤Ä¤ÎÏÇÀ±¤Î´Ö¤ò°ÜÆ°¤¹¤ë´Ö¡¢Å¨¤ÈÁø¶ø¤¹¤ë¤³¤È¤¬¤¢¤ë¡£
+  ¤½¤Î¾ì¹ç¡¢ºîÀï¼Â¹Ô¤ÈƱ¤¸¤è¤¦¤Ê¾õ¶·¤Ë¤Ê¤ë¡£
+  Ç¤Ì³¤Ï¹¶·â¤·¤Æ¤¯¤ë·Þ·âµ¡¤òÁ´¤ÆÇÓ½ü¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£
+  ¤½¤ì¤¬´°Î»¤¹¤ë¤È¡¢¥×¥ì¥¤¥ä¡¼¤Ï¼«Í³¤Ë¤Ê¤ê¤½¤Î¾ì¤òÎ¥¤ì¤ë¡£</p>
 
-  <p>\8bà\82Í\83t\83@\83C\83A\83t\83\89\83C\82Ì\8b­\89»\82â\92e\96ò\82Ì\8dw\93ü\82Å\8eg\82¤\81B
-  \8dì\90í\8aÔ\89æ\96Ê\82Ì\81u\83t\83@\83C\83A\83t\83\89\83C\82ð\8b­\89»\81v\82Å\8dw\93ü\82·\82é\82±\82Æ\82ª\82Å\82«\82é\81B</p>
+  <p>Ũ¤È¤ÎÁø¶ø¤Ë¤ÏÊ̤ÎÌÜŪ¤¬¤¢¤ë¾ì¹ç¤â¤¢¤ë - WEAPCO¥Ñ¥È¥í¡¼¥ë¤¬ÅÛÎì¤òÈÂÁ÷¤·¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ç¤¢¤ë¡£
+  ¤½¤Î¾ì¹ç¡¢Ç¤Ì³¤Î1¤Ä¤Ï°ìÄê¿ô¤ÎÅÛÎì¤òµß½Ð¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£
+  ¤³¤ì¤ÏÁø¶ø¤·¤¿¾ì¹ç¤Î¤ß²Äǽ¤Ç¤¢¤ë¡£</p>
+
+  <p>³Ð¤¨¤Æ¤ª¤¯¤Ù¤­½ÅÍפʤ³¤È¤Î1¤Ä¤Ï¡¢Å¨¤ÈÁø¶ø¤·¤Æ¼õ¤±¤¿¥À¥á¡¼¥¸¤ÏÌÜŪ¤ÎÏÇÀ±¤ËÅþ㤹¤ë¤Þ¤Ç²óÉü¤·¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£
+  ¤â¤·¥×¥ì¥¤¥ä¡¼¤¬Å¨¤ÈÁø¶ø¤·¤ÆÂç¥À¥á¡¼¥¸¤ò¼õ¤±¤¿¾ì¹ç¤Ç¤â¡¢ºÆ¤ÓŨ¤Î¹¶·â¤Ë¤¢¤¦¤³¤È¤¬¤¢¤ë¡£
+  ¤³¤ì¤Ï¤È¤Æ¤â´í¸±¤Ê¾õ¶·¤Ç¤¢¤ë¡£</p>
+
+  <h2>ÁõÈ÷¤È¶¯²½</h2>
+
+  <p>¥²¡¼¥à¤ÎÅÓÃæ¤Ç¶â(¥­¥ã¥Ã¥·¥å)¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+  ¶â¤ÏÇ˲õ¤µ¤ì¤¿Å¨¤Î´ÏÁ¥¤«¤éÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+  (ÏÇÀ±´Ö¤ÇÁø¶ø¤·¤¿Å¨¤«¤é¤Ï¶â¤òÆÀ¤é¤ì¤Ê¤¤¤Î¤ÇÃí°Õ¤¹¤ë¤³¤È¡£)</p>
+
+  <p>¶â¤Ï¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¶¯²½¤äÃÆÌô¤Î¹ØÆþ¤Ç»È¤¦¡£
+  ºîÀï´Ö²èÌ̤Ρ֥ե¡¥¤¥¢¥Õ¥é¥¤¤ò¶¯²½¡×¤Ç¹ØÆþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£</p>
 
   <dl>
-  <dt>\88ê\8e\9e\8b­\89»</dt>
+  <dt>°ì»þ¶¯²½</dt>
 
   <dd>
-    \88ê\8e\9e\8b­\89»\82Í\81A\83t\83@\83C\83A\83t\83\89\83C\82Ì\83p\83\8f\81[\83A\83b\83v\8e\9e\82Ì\94\\97Í\82ð\8d\82\82ß\82é\81B
-    \97á\82¦\82Î\81A\83Q\81[\83\80\8aJ\8en\8e\9e\82Í\83t\83@\83C\83A\83t\83\89\83C\82Í\88ê\93x\82É2\94­\82Ì\83v\83\89\83Y\83}\92e\82µ\82©\94­\8eË\82Å\82«\82È\82¢\81B
-    \82µ\82©\82µ\81A\83t\83@\83C\83A\83t\83\89\83C\82ð\8b­\89»\82·\82é\82±\82Æ\82Å\81A\83p\83\8f\81[\83A\83b\83v\8e\9e\82É\8dÅ\91å5\94­\82Ì\83v\83\89\83Y\83}\92e\82ð\94­\8eË\82Å\82«\82é\82æ\82¤\82É\82È\82é\81B
-    \82±\82ê\82Í\83p\83\8f\81[\83A\83b\83v\83A\83C\83e\83\80\82ð\8al\93¾\82µ\82½\8fê\8d\87\82Ì\82Ý\8cø\89Ê\82ª\82 \82è\81A\83v\83\89\83Y\83}\89Î\96ò\82É\82æ\82é\90§\8cÀ\82à\82 \82é\81B
-    \92Ê\8fí\8e\9e\82Ì\8b­\89»\82Ì\82½\82ß\82É\82Í\81A\8dP\8bv\8b­\89»\82ª\95K\97v\82Å\82 \82é(\8e\9f\82ð\8eQ\8fÆ\82·\82é\82±\82Æ)\81B
+    °ì»þ¶¯²½¤Ï¡¢¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¥Ñ¥ï¡¼¥¢¥Ã¥×»þ¤ÎǽÎϤò¹â¤á¤ë¡£
+    Î㤨¤Ð¡¢¥²¡¼¥à³«»Ï»þ¤Ï¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Ï°ìÅÙ¤Ë2ȯ¤Î¥×¥é¥º¥ÞÃƤ·¤«È¯¼Í¤Ç¤­¤Ê¤¤¡£
+    ¤·¤«¤·¡¢¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ò¶¯²½¤¹¤ë¤³¤È¤Ç¡¢¥Ñ¥ï¡¼¥¢¥Ã¥×»þ¤ËºÇÂç5ȯ¤Î¥×¥é¥º¥ÞÃƤòȯ¼Í¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£
+    ¤³¤ì¤Ï¥Ñ¥ï¡¼¥¢¥Ã¥×¥¢¥¤¥Æ¥à¤ò³ÍÆÀ¤·¤¿¾ì¹ç¤Î¤ß¸ú²Ì¤¬¤¢¤ê¡¢¥×¥é¥º¥Þ²ÐÌô¤Ë¤è¤ëÀ©¸Â¤â¤¢¤ë¡£
+    Ä̾ï»þ¤Î¶¯²½¤Î¤¿¤á¤Ë¤Ï¡¢¹±µ×¶¯²½¤¬É¬ÍפǤ¢¤ë(¼¡¤ò»²¾È¤¹¤ë¤³¤È)¡£
   </dd>
 
-  <dt>\8dP\8bv\8b­\89»</dt>
+  <dt>¹±µ×¶¯²½</dt>
 
   <dd>
-    \82±\82ê\82ç\82Ì\8b­\89»\82Í\88ê\8e\9e\8b­\89»\82æ\82è\82à\8d\82\89¿\82Å\82 \82é\82ª\81A\8dP\8bv\93I\82É\91±\82­\82à\82Ì\82Å\82 \82é\81B
-    \88ê\8e\9e\8b­\89»\82ª\83p\83\8f\81[\83A\83b\83v\83A\83C\83e\83\80\82Ì\8al\93¾\82Æ\83v\83\89\83Y\83}\89Î\96ò\82ª\95K\97v\82Å\82 \82é\82Ì\82É\91Î\82µ\81A\8dP\8bv\8b­\89»\82É\82Í\90§\8cÀ\82ª\82È\82¢\81B
-    \82±\82ê\82Í\81A\8c©\82Â\82¯\82½\83v\83\89\83Y\83}\89Î\96ò\82â\83p\83\8f\81[\83A\83b\83v\83A\83C\83e\83\80\82ð\8eæ\82é\95K\97v\82ª\82È\82¢\82½\82ß\81A\8b­\97Í\82É\83V\81[\83\8b\83h\82³\82ê\82½\93G\82Æ\90í\82¤\82Æ\82«\82É\8bÉ\82ß\82Ä\97L\97p\82Å\82 \82é\81B
-    \8dP\8bv\8b­\89»\82ð\8ds\82¢\81A\88ê\8e\9e\8b­\89»\82Ì\83\8c\83x\83\8b\82ª\82»\82ê\82æ\82è\82à\92á\82¢\8fê\8d\87\82Í\81A\8e©\93®\93I\82É\82»\82¿\82ç\82à\83\8c\83x\83\8b\82ª\8fã\82ª\82é\81B
-    \83t\83@\83C\83A\83t\83\89\83C\82Ì\8eå\91\95\94õ\82ª\8dÅ\91å\8fo\97Í\82É\82È\82Á\82½\8fê\8d\87(\83v\83\89\83Y\83}\83J\83m\83\933\96å)\81ASHIFT\83L\81[\82ð\89\9f\82µ\82Ä\8fW\92\86(\83f\83t\83H\83\8b\83g)\82Æ\8ag\8eU\82Ì2\82Â\82ð\90Ø\82è\91Ö\82¦\81A\97l\81X\82È\8fó\8bµ\82É\91Î\89\9e\82Å\82«\82é\82æ\82¤\82É\82È\82é\81B
+    ¤³¤ì¤é¤Î¶¯²½¤Ï°ì»þ¶¯²½¤è¤ê¤â¹â²Á¤Ç¤¢¤ë¤¬¡¢¹±µ×Ū¤Ë³¤¯¤â¤Î¤Ç¤¢¤ë¡£
+    °ì»þ¶¯²½¤¬¥Ñ¥ï¡¼¥¢¥Ã¥×¥¢¥¤¥Æ¥à¤Î³ÍÆÀ¤È¥×¥é¥º¥Þ²ÐÌô¤¬É¬ÍפǤ¢¤ë¤Î¤ËÂФ·¡¢¹±µ×¶¯²½¤Ë¤ÏÀ©¸Â¤¬¤Ê¤¤¡£
+    ¤³¤ì¤Ï¡¢¸«¤Ä¤±¤¿¥×¥é¥º¥Þ²ÐÌô¤ä¥Ñ¥ï¡¼¥¢¥Ã¥×¥¢¥¤¥Æ¥à¤ò¼è¤ëɬÍפ¬¤Ê¤¤¤¿¤á¡¢¶¯ÎϤ˥·¡¼¥ë¥É¤µ¤ì¤¿Å¨¤ÈÀ臘¤È¤­¤Ë¶Ë¤á¤ÆÍ­ÍѤǤ¢¤ë¡£
+    ¹±µ×¶¯²½¤ò¹Ô¤¤¡¢°ì»þ¶¯²½¤Î¥ì¥Ù¥ë¤¬¤½¤ì¤è¤ê¤âÄ㤤¾ì¹ç¤Ï¡¢¼«Æ°Åª¤Ë¤½¤Á¤é¤â¥ì¥Ù¥ë¤¬¾å¤¬¤ë¡£
+    ¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¼çÁõÈ÷¤¬ºÇÂç½ÐÎϤˤʤ俾ì¹ç(¥×¥é¥º¥Þ¥«¥Î¥ó3Ìç)¡¢SHIFT¥­¡¼¤ò²¡¤·¤Æ½¸Ãæ(¥Ç¥Õ¥©¥ë¥È)¤È³È»¶¤Î2¤Ä¤òÀÚ¤êÂؤ¨¡¢ÍÍ¡¹¤Ê¾õ¶·¤ËÂбþ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¡£
   </dd>
 
-  <dt>\95\9b\91\95\94õ</dt>
+  <dt>ÉûÁõÈ÷</dt>
 
   <dd>
-    \8eå\91\95\94õ\82â\88ê\8e\9e\8b­\89»\82Æ\93¯\97l\82É\81A\83t\83@\83C\83A\83t\83\89\83C\82É\82Í\95â\8f\95\93I\82È\95\90\8aí\82ð\91\95\94õ\82·\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-    \83Q\81[\83\80\8aJ\8en\8e\9e\82É\82Í\83\8d\83P\83b\83g\83\89\83\93\83`\83\83\81[\82ð\91\95\94õ\82µ\82Ä\82¢\82é\81B
-    \91¼\82Ì\91\95\94õ\82à\8dw\93ü\82·\82é\82±\82Æ\82ª\82Å\82«\82é\81B
-    \83Q\81[\83\80\8aJ\8en\8e\9e\82É\82Í\81A2\98A\91\95\83\8d\83P\83b\83g\83\89\83\93\83`\83\83\81[\82Æ\83}\83C\83N\83\8d\83\8d\83P\83b\83g\83\89\83\93\83`\83\83\81[\82ª\89Â\94\\82Å\82 \82é\81B
-    \91¼\82Ì\95\9b\91\95\94õ\82à\83\8d\83P\83b\83g\83\89\83\93\83`\83\83\81[\82Æ\93¯\82\95û\96@\82Å\8eg\82¤\82±\82Æ\82ª\82Å\82«\82é(SPACE\83L\81[\82Å\94­\8eË)\81B
-    \82µ\82©\82µ\81A\83\8c\81[\83U\81[\83J\83m\83\93\82Æ\83`\83\83\81[\83W\83J\83m\83\93\82Í\88Ù\82È\82é\81B
-    \83`\83\83\81[\83W\83J\83m\83\93\82Æ\83\8c\81[\83U\81[\83J\83m\83\93\82É\82Í(\91¼\82Ì\83\8d\83P\83b\83g\95º\8aí\82Æ\82Í\88Ù\82È\82è)\94­\8eË\82Ì\90§\8cÀ\82ª\82 \82é\81B
-    \83`\83\83\81[\83W\83J\83m\83\93\82ÍSPACE\83L\81[\82ð\89\9f\82µ\91±\82¯\82½\8cã\82É\97£\82·\82±\82Æ\82Å\8eg\97p\82·\82é\81B
-    \89æ\96Ê\82Ì\89º\82Ì\83\81\81[\83^\81[\82Í\82­\82ç\82¢\97­\82ß\82ç\82ê\82½\82©\82ð\95\\82·\81B
-    \83\8c\81[\83U\81[\83J\83m\83\93\82ÍSPACE\83L\81[\82ð\89\9f\82µ\91±\82¯\82é\82±\82Æ\82Å\83\8c\81[\83U\81[\82ð\94­\8eË\82·\82é\81B
-    \83I\81[\83o\81[\83q\81[\83g\82Ì\8fê\8d\87\82Í\97â\8bp\82·\82é\82Ü\82Å\8eg\82¦\82È\82¢\81B
+    ¼çÁõÈ÷¤ä°ì»þ¶¯²½¤ÈƱÍͤˡ¢¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Ë¤ÏÊä½õŪ¤ÊÉð´ï¤òÁõÈ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+    ¥²¡¼¥à³«»Ï»þ¤Ë¤Ï¥í¥±¥Ã¥È¥é¥ó¥Á¥ã¡¼¤òÁõÈ÷¤·¤Æ¤¤¤ë¡£
+    Â¾¤ÎÁõÈ÷¤â¹ØÆþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+    ¥²¡¼¥à³«»Ï»þ¤Ë¤Ï¡¢2Ï¢Áõ¥í¥±¥Ã¥È¥é¥ó¥Á¥ã¡¼¤È¥Þ¥¤¥¯¥í¥í¥±¥Ã¥È¥é¥ó¥Á¥ã¡¼¤¬²Äǽ¤Ç¤¢¤ë¡£
+    Â¾¤ÎÉûÁõÈ÷¤â¥í¥±¥Ã¥È¥é¥ó¥Á¥ã¡¼¤ÈƱ¤¸ÊýË¡¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤ë(SPACE¥­¡¼¤Çȯ¼Í)¡£
+    ¤·¤«¤·¡¢¥ì¡¼¥¶¡¼¥«¥Î¥ó¤È¥Á¥ã¡¼¥¸¥«¥Î¥ó¤Ï°Û¤Ê¤ë¡£
+    ¥Á¥ã¡¼¥¸¥«¥Î¥ó¤È¥ì¡¼¥¶¡¼¥«¥Î¥ó¤Ë¤Ï(¾¤Î¥í¥±¥Ã¥Èʼ´ï¤È¤Ï°Û¤Ê¤ê)ȯ¼Í¤ÎÀ©¸Â¤¬¤¢¤ë¡£
+    ¥Á¥ã¡¼¥¸¥«¥Î¥ó¤ÏSPACE¥­¡¼¤ò²¡¤·Â³¤±¤¿¸å¤ËÎ¥¤¹¤³¤È¤Ç»ÈÍѤ¹¤ë¡£
+    ²èÌ̤β¼¤Î¥á¡¼¥¿¡¼¤Ï¤¯¤é¤¤Î¯¤á¤é¤ì¤¿¤«¤òɽ¤¹¡£
+    ¥ì¡¼¥¶¡¼¥«¥Î¥ó¤ÏSPACE¥­¡¼¤ò²¡¤·Â³¤±¤ë¤³¤È¤Ç¥ì¡¼¥¶¡¼¤òȯ¼Í¤¹¤ë¡£
+    ¥ª¡¼¥Ð¡¼¥Ò¡¼¥È¤Î¾ì¹ç¤ÏÎäµÑ¤¹¤ë¤Þ¤Ç»È¤¨¤Ê¤¤¡£
   </dd>
   </dl>
 
-  <p>\91\95\94õ\82Ì\8b­\89»\82Í\83Q\81[\83\80\82ª\82 \82é\92ö\93x\90i\82Þ\82Ü\82Å\82Å\82«\82È\82¢\82Ì\82Å\81A\8bà\82ð\92\99\82ß\82é\82Ì\82ð\96Y\82ê\82È\82¢\82±\82Æ\81B</p>
+  <p>ÁõÈ÷¤Î¶¯²½¤Ï¥²¡¼¥à¤¬¤¢¤ëÄøÅٿʤà¤Þ¤Ç¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¶â¤òÃù¤á¤ë¤Î¤ò˺¤ì¤Ê¤¤¤³¤È¡£</p>
 
-  <h2>\83A\83C\83e\83\80</h2>
+  <h2>¥¢¥¤¥Æ¥à</h2>
 
-  <p>\93G\82Ì\8aÍ\91D\82ð\94j\89ó\82·\82é\82Æ\81A\83A\83C\83e\83\80\82â\83L\83\83\83b\83V\83\85\82ð\97\8e\82Æ\82·\82±\82Æ\82ª\82 \82é\81B
-  \88ê\95\94\82Ì\93G\82Í\83p\83\8f\81[\83A\83b\83v\83A\83C\83e\83\80\82ð\97\8e\82Æ\82µ\81A\82»\82ê\82ð\8eæ\82é\82Æ\95\90\8aí\82ª\88ê\8e\9e\93I\82É\8b­\89»\82³\82ê\82é\81B
-  \88È\89º\82Í\8dì\90í\82Ì\8dÅ\92\86\82É\8al\93¾\82Å\82«\82é\83A\83C\83e\83\80\82Ì\88ê\97\97\82Å\82 \82é:</p>
+  <p>Ũ¤Î´ÏÁ¥¤òÇ˲õ¤¹¤ë¤È¡¢¥¢¥¤¥Æ¥à¤ä¥­¥ã¥Ã¥·¥å¤òÍî¤È¤¹¤³¤È¤¬¤¢¤ë¡£
+  °ìÉô¤ÎŨ¤Ï¥Ñ¥ï¡¼¥¢¥Ã¥×¥¢¥¤¥Æ¥à¤òÍî¤È¤·¡¢¤½¤ì¤ò¼è¤ë¤ÈÉð´ï¤¬°ì»þŪ¤Ë¶¯²½¤µ¤ì¤ë¡£
+  °Ê²¼¤ÏºîÀï¤ÎºÇÃæ¤Ë³ÍÆÀ¤Ç¤­¤ë¥¢¥¤¥Æ¥à¤Î°ìÍ÷¤Ç¤¢¤ë:</p>
 
   <table summary="Description of all item spheres.">
     <tr>
-      <td><img src="../gfx/dollar.png" alt="Cash"></td>
-      <td><b>\83L\83\83\83b\83V\83\85</b> - \8eû\93ü\82É\82È\82é</td>
+      <td><img src="dollar.png" alt="Cash"></td>
+      <td><b>¥­¥ã¥Ã¥·¥å</b> - ¼ýÆþ¤Ë¤Ê¤ë</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/rocket.png" alt="Plasma Ammo"></td>
-      <td><b>\83v\83\89\83Y\83}\89Î\96ò</b> - \83v\83\89\83Y\83}\89Î\96ò\82ª\91\9d\82¦\82é</td>
+      <td><img src="rocket.png" alt="Plasma Ammo"></td>
+      <td><b>¥×¥é¥º¥Þ²ÐÌô</b> - ¥×¥é¥º¥Þ²ÐÌô¤¬Áý¤¨¤ë</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/rocketAmmo.png" alt="Rocket Ammo"></td>
-      <td><b>\83\8d\83P\83b\83g\92e</b> - \83\8d\83P\83b\83g\92e\82ª\91\9d\82¦\82é</td>
+      <td><img src="rocketAmmo.png" alt="Rocket Ammo"></td>
+      <td><b>¥í¥±¥Ã¥ÈÃÆ</b> - ¥í¥±¥Ã¥ÈÃƤ¬Áý¤¨¤ë</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/heart.png" alt="Shield Sphere"></td>
-      <td><b>\83V\81[\83\8b\83h</b> - \83V\81[\83\8b\83h\82ª\89ñ\95\9c\82·\82é</td>
+      <td><img src="heart.png" alt="Shield Sphere"></td>
+      <td><b>¥·¡¼¥ë¥É</b> - ¥·¡¼¥ë¥É¤¬²óÉü¤¹¤ë</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/plasmaDamage.png" alt="Plasma Power"></td>
-      <td><b>\83v\83\89\83Y\83}\89Î\97Í\83u\81[\83X\83^\81[</b> - \83v\83\89\83Y\83}\92e\82Ì\89Î\97Í\82ª\91\9d\82·</td>
+      <td><img src="plasmaDamage.png" alt="Plasma Power"></td>
+      <td><b>¥×¥é¥º¥Þ²ÐÎÏ¥Ö¡¼¥¹¥¿¡¼</b> - ¥×¥é¥º¥ÞÃƤβÐÎϤ¬Áý¤¹</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/plasmaAmmo.png" alt="Plasma Output"></td>
-      <td><b>\83v\83\89\83Y\83}\8fo\97Í\94Í\88Í\83u\81[\83X\83^\81[</b> - \88ê\93x\82É\94­\8eË\82Å\82«\82é\83v\83\89\83Y\83}\92e\82Ì\90\94\82ª\91\9d\82·</td>
+      <td><img src="plasmaAmmo.png" alt="Plasma Output"></td>
+      <td><b>¥×¥é¥º¥Þ½ÐÎÏÈÏ°Ï¥Ö¡¼¥¹¥¿¡¼</b> - °ìÅÙ¤Ëȯ¼Í¤Ç¤­¤ë¥×¥é¥º¥ÞÃƤοô¤¬Áý¤¹</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/plasmaRate.png" alt="Plasma Coolor"></td>
-      <td><b>\83v\83\89\83Y\83}\97â\8bp\83u\81[\83X\83^\81[</b> - \83v\83\89\83Y\83}\92e\82Ì\98A\8eË\91¬\93x\82ª\91\9d\82·</td>
+      <td><img src="plasmaRate.png" alt="Plasma Coolor"></td>
+      <td><b>¥×¥é¥º¥ÞÎäµÑ¥Ö¡¼¥¹¥¿¡¼</b> - ¥×¥é¥º¥ÞÃƤÎÏ¢¼Í®ÅÙ¤¬Áý¤¹</td>
     </tr>
 
     <tr>
-      <td><img src="../gfx/superCharge.png" alt="Super Charge"></td>
-      <td><b>\83X\81[\83p\81[\83`\83\83\81[\83W</b> - 5\95û\8cü\82Ö\82Ì\8ag\8eU\81A\8b­\97Í\82È\89Î\97Í\82Æ\97â\8bp\82ð\93¾\82é (\82Ü\82ê)</td>
+      <td><img src="superCharge.png" alt="Super Charge"></td>
+      <td><b>¥¹¡¼¥Ñ¡¼¥Á¥ã¡¼¥¸</b> - 5Êý¸þ¤Ø¤Î³È»¶¡¢¶¯ÎϤʲÐÎϤÈÎäµÑ¤òÆÀ¤ë (¤Þ¤ì)</td>
     </tr>
   </table>
 
-  <h2>\83J\83b\83g\83V\81[\83\93</h2>
+  <h2>¥«¥Ã¥È¥·¡¼¥ó</h2>
 
-  <p>\8dì\90í\82Ì\8cã\82É\92Z\82¢\83J\83b\83g\83V\81[\83\93\82ª\82 \82é\8fê\8d\87\82ª\82 \82é\81B
-  \82±\82Ì\83V\81[\83\93\82Å\82Í\95¨\8cê\82â\83Q\81[\83\80\82Ì\83q\83\93\83g\82ª\97^\82¦\82ç\82ê\82é\81B
-  \82±\82Ì\83V\81[\83\93\82ð\94ò\82Î\82µ\82½\82¢\8fê\8d\87\82ÍESC\83L\81[\82ð\89\9f\82·\81B
-  \82±\82Ì\83V\81[\83\93\82ð\94ò\82Î\82·\82Ì\82Í\8aù\82É\88ê\93x\8c©\82½\8fê\8d\87\82Ì\82Ý\82É\82µ\82½\95û\82ª\82æ\82¢\81B</p>
+  <p>ºîÀï¤Î¸å¤Ëû¤¤¥«¥Ã¥È¥·¡¼¥ó¤¬¤¢¤ë¾ì¹ç¤¬¤¢¤ë¡£
+  ¤³¤Î¥·¡¼¥ó¤Ç¤Ïʪ¸ì¤ä¥²¡¼¥à¤Î¥Ò¥ó¥È¤¬Í¿¤¨¤é¤ì¤ë¡£
+  ¤³¤Î¥·¡¼¥ó¤òÈô¤Ð¤·¤¿¤¤¾ì¹ç¤ÏESC¥­¡¼¤ò²¡¤¹¡£
+  ¤³¤Î¥·¡¼¥ó¤òÈô¤Ð¤¹¤Î¤Ï´û¤Ë°ìÅÙ¸«¤¿¾ì¹ç¤Î¤ß¤Ë¤·¤¿Êý¤¬¤è¤¤¡£</p>
 
-  <h2>\83Q\81[\83\80\8fI\97¹</h2>
+  <h2>¥²¡¼¥à½ªÎ»</h2>
 
-  <p>\83t\83@\83C\83A\83t\83\89\83C\82Ì\83V\81[\83\8b\83h\82ª0\82É\82È\82Á\82½\8fê\8d\87\82â\81A\8eå\97v\82È\8dì\90í\82É\8e¸\94s\82µ\82½\82Æ\82«\83Q\81[\83\80\83I\81[\83o\81[\82Æ\82È\82é\81B
-  \82±\82Ì\8fê\8d\87\81A\83Q\81[\83\80\83I\81[\83o\81[\89æ\96Ê\82ª\95\\8e¦\82³\82ê\82é\81B
-  \83R\83\93\83e\83j\83\85\81[\82·\82é\8fê\8d\87\82Í\81ACTRL\82Ü\82½\82ÍSPACE\83L\81[\82ð\89\9f\82·\81B
-  \91¼\82Ì\83L\81[\82ð\89\9f\82·\82Æ\83^\83C\83g\83\8b\89æ\96Ê\82É\96ß\82é\81B
-  \88ê\95\94\82Ì\8dì\90í\82Å\82Í\81A\83V\83h\81E\83E\83B\83\8b\83\\83\93\82ª\8eE\8aQ\82³\82ê\82é\82Æ\83Q\81[\83\80\83I\81[\83o\81[\82Æ\82È\82é\81B</p>
+  <p>¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¥·¡¼¥ë¥É¤¬0¤Ë¤Ê¤Ã¤¿¾ì¹ç¤ä¡¢¼çÍפʺîÀï¤Ë¼ºÇÔ¤·¤¿¤È¤­¥²¡¼¥à¥ª¡¼¥Ð¡¼¤È¤Ê¤ë¡£
+  ¤³¤Î¾ì¹ç¡¢¥²¡¼¥à¥ª¡¼¥Ð¡¼²èÌ̤¬É½¼¨¤µ¤ì¤ë¡£
+  ¥³¥ó¥Æ¥Ë¥å¡¼¤¹¤ë¾ì¹ç¤Ï¡¢CTRL¤Þ¤¿¤ÏSPACE¥­¡¼¤ò²¡¤¹¡£
+  Â¾¤Î¥­¡¼¤ò²¡¤¹¤È¥¿¥¤¥È¥ë²èÌ̤ËÌá¤ë¡£
+  °ìÉô¤ÎºîÀï¤Ç¤Ï¡¢¥·¥É¡¦¥¦¥£¥ë¥½¥ó¤¬»¦³²¤µ¤ì¤ë¤È¥²¡¼¥à¥ª¡¼¥Ð¡¼¤È¤Ê¤ë¡£</p>
 
-  <h2>\82±\82Ì\83Q\81[\83\80\82É\82Â\82¢\82Ä</h2>
+  <h2>¤³¤Î¥²¡¼¥à¤Ë¤Ä¤¤¤Æ</h2>
 
-  <p>Parallel Realities\82ÍAmiga\8fã\82Å\8dÅ\8f\89\82ÍAMOS\81A\8cã\82ÉBlitz Basic 2\82ð\8eg\82Á\82Ä\83Q\81[\83\80\82ð\8dì\90¬\82µ\82Ä\82¢\82½\81B
-  \8dì\82ç\82ê\82½\83Q\81[\83\80\82ÍBOTSS Trilogy\82â\81A\93Á\82ÉTANX Squadron\82Ì\8b­\82¢\89e\8b¿\82ð\8eó\82¯\82Ä\82¢\82½\81B
-  TANX Squadron\82Í1999\94N\89Ä\82ÉAmiga Format's contributor prize\82ð\8eó\8fÜ\82µ\82½\83Q\81[\83\80\82Å\82 \82é\81B
-  Project: Starfighter\82Ì\8dì\90¬\82Í\81A\8dÅ\8f\89\82ÍAmiga\8fã\82Å\8en\82Ü\82Á\82½\82ª\81A\82»\82ê\82Í\8a®\90¬\82µ\82È\82©\82Á\82½\81B
-  2002\94N\81A\8f\89\82ß\82ÄC\8c¾\8cê\82ð\8eg\82Á\82ÄLinux\8fã\82Å\8dì\90¬\82ª\8dÄ\8aJ\82³\82ê\82½\81B
-  \82±\82Ì\83Q\81[\83\80\82Í\81A\8dÅ\8f\89\82Í\8aÈ\92P\82È\83A\83C\83f\83A\82Å\8en\82Ü\82è\81A\90¬\89Ê\95¨\82Æ\82µ\82Ä\8a®\90¬\82µ\82½\81B
-  \89ä\81X\82Í\8ay\82µ\82ñ\82Å\82à\82ç\82¦\82é\82±\82Æ\82ð\8aè\82Á\82Ä\82¢\82é\81B
-  </p>
+  <p>Parallel Realities¤ÏAmiga¾å¤ÇºÇ½é¤ÏAMOS¡¢¸å¤ËBlitz Basic 2¤ò»È¤Ã¤Æ¥²¡¼¥à¤òºîÀ®¤·¤Æ¤¤¤¿¡£
+  ºî¤é¤ì¤¿¥²¡¼¥à¤ÏBOTSS Trilogy¤ä¡¢ÆäËTANX Squadron¤Î¶¯¤¤±Æ¶Á¤ò¼õ¤±¤Æ¤¤¤¿¡£
+  TANX Squadron¤Ï1999ǯ²Æ¤ËAmiga Format's contributor prize¤ò¼õ¾Þ¤·¤¿¥²¡¼¥à¤Ç¤¢¤ë¡£
+  Project: Starfighter¤ÎºîÀ®¤Ï¡¢ºÇ½é¤ÏAmiga¾å¤Ç»Ï¤Þ¤Ã¤¿¤¬¡¢¤½¤ì¤Ï´°À®¤·¤Ê¤«¤Ã¤¿¡£
+  2002ǯ¡¢½é¤á¤ÆC¸À¸ì¤ò»È¤Ã¤ÆLinux¾å¤ÇºîÀ®¤¬ºÆ³«¤µ¤ì¤¿¡£
+  ¤³¤Î¥²¡¼¥à¤Ï¡¢ºÇ½é¤Ï´Êñ¤Ê¥¢¥¤¥Ç¥¢¤Ç»Ï¤Þ¤ê¡¢À®²Ìʪ¤È¤·¤Æ´°À®¤·¤¿¡£
+  ²æ¡¹¤Ï³Ú¤·¤ó¤Ç¤â¤é¤¨¤ë¤³¤È¤ò´ê¤Ã¤Æ¤¤¤ë¡£</p>
 
-  <p>Project: Starfighter<br>
-  Copyright &copy; 2003 Parallel Realities<br>
+  <p>Project: Starfighter<br />
+  Copyright &copy; 2003 Parallel Realities<br />
   Copyright &copy; 2012 Guus Sliepen, Astrid S. de Wijn and
-  others<br></p>
+  others<br />
+  Copyright &copy; 2015, 2016 onpon4</p>
 
-  <p>\8dì\90¬\82É\82Í<a href="http://www.libsdl.org">SDL\83\89\83C\83u\83\89\83\8a</a>\82ð\8eg\97p\82µ\82Ä\82¢\82é\81B</p>
+  <p>Created using the <a href="http://www.libsdl.org">SDL
+  library</a>.</p>
 
-  <p align="right">\8c´\8dì:<a href="http://starfighter.nongnu.org">http://starfighter.nongnu.org</a><br>
-  \93ú\96{\8cê\96ó\94Å:<a href="https://osdn.jp/projects/starfighter-jp/">https://osdn.jp/projects/starfighter-jp/</a></p>
+  <p align="right">¸¶ºî:<a href="http://starfighter.nongnu.org">http://starfighter.nongnu.org</a><br>
+  ÆüËܸìÌõÈÇ:<a href="https://osdn.jp/projects/starfighter-jp/">https://osdn.jp/projects/starfighter-jp/</a></p>
 </body>
 </html>
index 9524eef..1fd89ec 100644 (file)
Binary files a/docs/plasmaAmmo.png and b/docs/plasmaAmmo.png differ
index 7c42a0c..8339e68 100644 (file)
Binary files a/docs/plasmaDamage.png and b/docs/plasmaDamage.png differ
index a25ea04..a2b6d91 100644 (file)
Binary files a/docs/plasmaRate.png and b/docs/plasmaRate.png differ
index 22a5c43..a85187a 100644 (file)
Binary files a/docs/rocket.png and b/docs/rocket.png differ
index ae4792f..eea41cd 100644 (file)
Binary files a/docs/rocketAmmo.png and b/docs/rocketAmmo.png differ
index e9e0ecb..b0aca78 100644 (file)
Binary files a/docs/sflogo.png and b/docs/sflogo.png differ
index 17e3009..4d3dddd 100644 (file)
Binary files a/docs/superCharge.png and b/docs/superCharge.png differ
diff --git a/gfx/friendArrowEast.png b/gfx/friendArrowEast.png
new file mode 100644 (file)
index 0000000..420652b
Binary files /dev/null and b/gfx/friendArrowEast.png differ
diff --git a/gfx/friendArrowNorth.png b/gfx/friendArrowNorth.png
new file mode 100644 (file)
index 0000000..19ab306
Binary files /dev/null and b/gfx/friendArrowNorth.png differ
diff --git a/gfx/friendArrowNorthEast.png b/gfx/friendArrowNorthEast.png
new file mode 100644 (file)
index 0000000..3b351f9
Binary files /dev/null and b/gfx/friendArrowNorthEast.png differ
diff --git a/gfx/friendArrowNorthWest.png b/gfx/friendArrowNorthWest.png
new file mode 100644 (file)
index 0000000..e1d2d00
Binary files /dev/null and b/gfx/friendArrowNorthWest.png differ
diff --git a/gfx/friendArrowSouth.png b/gfx/friendArrowSouth.png
new file mode 100644 (file)
index 0000000..033cd9d
Binary files /dev/null and b/gfx/friendArrowSouth.png differ
diff --git a/gfx/friendArrowSouthEast.png b/gfx/friendArrowSouthEast.png
new file mode 100644 (file)
index 0000000..a478025
Binary files /dev/null and b/gfx/friendArrowSouthEast.png differ
diff --git a/gfx/friendArrowSouthWest.png b/gfx/friendArrowSouthWest.png
new file mode 100644 (file)
index 0000000..ce32b7d
Binary files /dev/null and b/gfx/friendArrowSouthWest.png differ
diff --git a/gfx/friendArrowWest.png b/gfx/friendArrowWest.png
new file mode 100644 (file)
index 0000000..312c9a5
Binary files /dev/null and b/gfx/friendArrowWest.png differ
diff --git a/gfx/klineText.png b/gfx/klineText.png
new file mode 100644 (file)
index 0000000..8b93e3a
Binary files /dev/null and b/gfx/klineText.png differ
diff --git a/gfx/phoebeText.png b/gfx/phoebeText.png
new file mode 100644 (file)
index 0000000..873f1f3
Binary files /dev/null and b/gfx/phoebeText.png differ
diff --git a/gfx/sidText.png b/gfx/sidText.png
new file mode 100644 (file)
index 0000000..66790d8
Binary files /dev/null and b/gfx/sidText.png differ
diff --git a/gfx/ursulaText.png b/gfx/ursulaText.png
new file mode 100644 (file)
index 0000000..4f07b35
Binary files /dev/null and b/gfx/ursulaText.png differ
diff --git a/icon.ico b/icon.ico
deleted file mode 100644 (file)
index d486d9f..0000000
Binary files a/icon.ico and /dev/null differ
diff --git a/misc/starfighter.desktop b/misc/starfighter.desktop
new file mode 100644 (file)
index 0000000..cf391a7
--- /dev/null
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Project: Starfighter
+GenericName=Starfighter
+Comment=Liberate the universe from the evil company WEAPCO
+Type=Application
+Exec=starfighter
+Icon=starfighter
+Categories=Game;ActionGame;ArcadeGame;
+Terminal=false
+StartupNotify=false
diff --git a/misc/starfighter.png b/misc/starfighter.png
new file mode 100644 (file)
index 0000000..633d87e
Binary files /dev/null and b/misc/starfighter.png differ
diff --git a/resource.rc b/resource.rc
deleted file mode 100644 (file)
index ee4227b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ID_APP ICON "icon.ico"
index ed91b8b..e579fcb 100644 (file)
@@ -2,7 +2,7 @@
 Project: Starfighter
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -78,32 +78,40 @@ int main(int argc, char **argv)
                }
        }
 
-       atexit(cleanUp);
+       atexit(engine_cleanup);
 
-       initGraphics();
-       initSystem(); // Opens video mode and sound
+       gfx_init();
+       engine_setMode();
        loadFont();
 
        if (cheatAttempt && !engine.cheat)
        {
-               clearScreen(black);
-               drawString("That doesn't work anymore", -1, 285, FONT_WHITE);
-               drawString("Try harder...", -1, 315, FONT_WHITE);
-               updateScreen();
+               screen_clear(black);
+               screen_renderString("That doesn't work anymore", -1, 285, FONT_WHITE);
+               screen_renderString("Try harder...", -1, 315, FONT_WHITE);
+               renderer_update();
                SDL_Delay(2000);
-               clearScreen(black);
-               updateScreen();
+               screen_clear(black);
+               renderer_update();
                SDL_Delay(500);
        }
 
-       freeGraphics();
+       gfx_free();
        audio_loadSounds();
 
        initWeapons();
-       initVars();
+
+       srand(time(NULL));
+
+       if (engine.useAudio)
+       {
+               Mix_Volume(-1, 100);
+               Mix_VolumeMusic(engine.musicVolume);
+       }
+
        alien_defs_init();
 
-       setColorIndexes();
+       colors_init();
 
        showStory();
 
@@ -127,7 +135,7 @@ int main(int argc, char **argv)
 
                        case 2:
                                if (game.stationedPlanet == -1)
-                                       doCutscene(0);
+                                       cutscene_init(0);
                                section = game_mainLoop();
                                break;
                }
index dd17d87..9bdbc83 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -40,22 +40,26 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "bullet.h"
 #include "cargo.h"
 #include "collectable.h"
+#include "colors.h"
+#include "cutscene.h"
 #include "engine.h"
+#include "event.h"
 #include "explosion.h"
 #include "game.h"
-#include "graphics.h"
-#include "init.h"
+#include "gfx.h"
 #include "intermission.h"
 #include "loadSave.h"
 #include "messages.h"
 #include "misc.h"
 #include "missions.h"
 #include "player.h"
+#include "renderer.h"
 #include "resources.h"
-#include "script.h"
+#include "screen.h"
 #include "ship.h"
 #include "shop.h"
 #include "title.h"
 #include "weapons.h"
+#include "window.h"
 
 #endif
index 1316ca2..70160fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -48,8 +48,8 @@ void alien_defs_init()
        alien_defs[CD_DUALFIGHTER].speed = 4;
        alien_defs[CD_DUALFIGHTER].maxShield = 5;
        alien_defs[CD_DUALFIGHTER].shield = 5;
-       alien_defs[CD_DUALFIGHTER].imageIndex[0] = 2;
-       alien_defs[CD_DUALFIGHTER].imageIndex[1] = 3;
+       alien_defs[CD_DUALFIGHTER].imageIndex[0] = SS_DUALFIGHTER;
+       alien_defs[CD_DUALFIGHTER].imageIndex[1] = SS_DUALFIGHTER_L;
        alien_defs[CD_DUALFIGHTER].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_DUALFIGHTER].weaponType[1] = W_ROCKETS;
        alien_defs[CD_DUALFIGHTER].chance[0] = 100;
@@ -65,8 +65,8 @@ void alien_defs_init()
        alien_defs[CD_MISSILEBOAT].speed = 2;
        alien_defs[CD_MISSILEBOAT].maxShield = 50;
        alien_defs[CD_MISSILEBOAT].shield = 50;
-       alien_defs[CD_MISSILEBOAT].imageIndex[0] = 4;
-       alien_defs[CD_MISSILEBOAT].imageIndex[1] = 5;
+       alien_defs[CD_MISSILEBOAT].imageIndex[0] = SS_MISSILEBOAT;
+       alien_defs[CD_MISSILEBOAT].imageIndex[1] = SS_MISSILEBOAT_L;
        alien_defs[CD_MISSILEBOAT].weaponType[0] = W_ROCKETS;
        alien_defs[CD_MISSILEBOAT].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_MISSILEBOAT].chance[0] = 25;
@@ -82,8 +82,8 @@ void alien_defs_init()
        alien_defs[CD_PROTOFIGHTER].speed = 5;
        alien_defs[CD_PROTOFIGHTER].maxShield = 15;
        alien_defs[CD_PROTOFIGHTER].shield = 15;
-       alien_defs[CD_PROTOFIGHTER].imageIndex[0] = 6;
-       alien_defs[CD_PROTOFIGHTER].imageIndex[1] = 7;
+       alien_defs[CD_PROTOFIGHTER].imageIndex[0] = SS_PROTOFIGHTER;
+       alien_defs[CD_PROTOFIGHTER].imageIndex[1] = SS_PROTOFIGHTER_L;
        alien_defs[CD_PROTOFIGHTER].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_PROTOFIGHTER].weaponType[1] = P_ANYTHING;
        alien_defs[CD_PROTOFIGHTER].chance[0] = 100;
@@ -99,8 +99,8 @@ void alien_defs_init()
        alien_defs[CD_FRIEND].speed = 3;
        alien_defs[CD_FRIEND].maxShield = 50;
        alien_defs[CD_FRIEND].shield = 50;
-       alien_defs[CD_FRIEND].imageIndex[0] = 20;
-       alien_defs[CD_FRIEND].imageIndex[1] = 21;
+       alien_defs[CD_FRIEND].imageIndex[0] = SS_FRIEND;
+       alien_defs[CD_FRIEND].imageIndex[1] = SS_FRIEND_L;
        alien_defs[CD_FRIEND].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_FRIEND].weaponType[1] = W_HOMING_MISSILE;
        alien_defs[CD_FRIEND].chance[0] = 100;
@@ -116,8 +116,8 @@ void alien_defs_init()
        alien_defs[CD_FRIGATE].speed = 2;
        alien_defs[CD_FRIGATE].maxShield = 550;
        alien_defs[CD_FRIGATE].shield = 550;
-       alien_defs[CD_FRIGATE].imageIndex[0] = 8;
-       alien_defs[CD_FRIGATE].imageIndex[1] = 9;
+       alien_defs[CD_FRIGATE].imageIndex[0] = SS_FRIGATE;
+       alien_defs[CD_FRIGATE].imageIndex[1] = SS_FRIGATE_L;
        alien_defs[CD_FRIGATE].weaponType[0] = W_MICRO_ROCKETS;
        alien_defs[CD_FRIGATE].weaponType[1] = W_ENERGYRAY;
        alien_defs[CD_FRIGATE].chance[0] = 100;
@@ -132,8 +132,8 @@ void alien_defs_init()
        alien_defs[CD_FRIGATE_WING1].speed = 2;
        alien_defs[CD_FRIGATE_WING1].maxShield = 100;
        alien_defs[CD_FRIGATE_WING1].shield = 100;
-       alien_defs[CD_FRIGATE_WING1].imageIndex[0] = 10;
-       alien_defs[CD_FRIGATE_WING1].imageIndex[1] = 11;
+       alien_defs[CD_FRIGATE_WING1].imageIndex[0] = SS_FRIGATE_WING1;
+       alien_defs[CD_FRIGATE_WING1].imageIndex[1] = SS_FRIGATE_WING1_L;
        alien_defs[CD_FRIGATE_WING1].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_FRIGATE_WING1].weaponType[1] = W_ROCKETS;
        alien_defs[CD_FRIGATE_WING1].chance[0] = 100;
@@ -148,8 +148,8 @@ void alien_defs_init()
        alien_defs[CD_FRIGATE_WING2].speed = 2;
        alien_defs[CD_FRIGATE_WING2].maxShield = 100;
        alien_defs[CD_FRIGATE_WING2].shield = 100;
-       alien_defs[CD_FRIGATE_WING2].imageIndex[0] = 12;
-       alien_defs[CD_FRIGATE_WING2].imageIndex[1] = 13;
+       alien_defs[CD_FRIGATE_WING2].imageIndex[0] = SS_FRIGATE_WING2;
+       alien_defs[CD_FRIGATE_WING2].imageIndex[1] = SS_FRIGATE_WING2_L;
        alien_defs[CD_FRIGATE_WING2].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_FRIGATE_WING2].weaponType[1] = W_ROCKETS;
        alien_defs[CD_FRIGATE_WING2].chance[0] = 100;
@@ -165,8 +165,8 @@ void alien_defs_init()
        alien_defs[CD_TRANSPORTSHIP].speed = 4;
        alien_defs[CD_TRANSPORTSHIP].maxShield = 10;
        alien_defs[CD_TRANSPORTSHIP].shield = 10;
-       alien_defs[CD_TRANSPORTSHIP].imageIndex[0] = 14;
-       alien_defs[CD_TRANSPORTSHIP].imageIndex[1] = 15;
+       alien_defs[CD_TRANSPORTSHIP].imageIndex[0] = SS_TRANSPORTSHIP;
+       alien_defs[CD_TRANSPORTSHIP].imageIndex[1] = SS_TRANSPORTSHIP_L;
        alien_defs[CD_TRANSPORTSHIP].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_TRANSPORTSHIP].weaponType[1] = W_DOUBLE_SHOT;
        alien_defs[CD_TRANSPORTSHIP].chance[0] = 0;
@@ -182,8 +182,8 @@ void alien_defs_init()
        alien_defs[CD_CARGOSHIP].speed = 4;
        alien_defs[CD_CARGOSHIP].maxShield = 10;
        alien_defs[CD_CARGOSHIP].shield = 10;
-       alien_defs[CD_CARGOSHIP].imageIndex[0] = 22;
-       alien_defs[CD_CARGOSHIP].imageIndex[1] = 23;
+       alien_defs[CD_CARGOSHIP].imageIndex[0] = SS_CARGOSHIP;
+       alien_defs[CD_CARGOSHIP].imageIndex[1] = SS_CARGOSHIP_L;
        alien_defs[CD_CARGOSHIP].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_CARGOSHIP].weaponType[1] = W_DOUBLE_SHOT;
        alien_defs[CD_CARGOSHIP].chance[0] = 0;
@@ -199,8 +199,8 @@ void alien_defs_init()
        alien_defs[CD_MINER].speed = 4;
        alien_defs[CD_MINER].maxShield = 25;
        alien_defs[CD_MINER].shield = 25;
-       alien_defs[CD_MINER].imageIndex[0] = 16;
-       alien_defs[CD_MINER].imageIndex[1] = 17;
+       alien_defs[CD_MINER].imageIndex[0] = SS_MINER;
+       alien_defs[CD_MINER].imageIndex[1] = SS_MINER_L;
        alien_defs[CD_MINER].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_MINER].weaponType[1] = W_DOUBLE_SHOT;
        alien_defs[CD_MINER].chance[0] = 0;
@@ -216,8 +216,8 @@ void alien_defs_init()
        alien_defs[CD_KLINE].speed = 5;
        alien_defs[CD_KLINE].maxShield = 2000;
        alien_defs[CD_KLINE].shield = 2000;
-       alien_defs[CD_KLINE].imageIndex[0] = 18;
-       alien_defs[CD_KLINE].imageIndex[1] = 19;
+       alien_defs[CD_KLINE].imageIndex[0] = SS_KLINE;
+       alien_defs[CD_KLINE].imageIndex[1] = SS_KLINE_L;
        alien_defs[CD_KLINE].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_KLINE].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_KLINE].chance[0] = 100;
@@ -233,8 +233,8 @@ void alien_defs_init()
        alien_defs[CD_AIMFIGHTER].speed = 3;
        alien_defs[CD_AIMFIGHTER].maxShield = 15;
        alien_defs[CD_AIMFIGHTER].shield = 15;
-       alien_defs[CD_AIMFIGHTER].imageIndex[0] = 8;
-       alien_defs[CD_AIMFIGHTER].imageIndex[1] = 9;
+       alien_defs[CD_AIMFIGHTER].imageIndex[0] = SS_AIMFIGHTER;
+       alien_defs[CD_AIMFIGHTER].imageIndex[1] = SS_AIMFIGHTER_L;
        alien_defs[CD_AIMFIGHTER].weaponType[0] = W_AIMED_SHOT;
        alien_defs[CD_AIMFIGHTER].weaponType[1] = W_AIMED_SHOT;
        alien_defs[CD_AIMFIGHTER].chance[0] = 7;
@@ -250,8 +250,8 @@ void alien_defs_init()
        alien_defs[CD_SLAVETRANSPORT].speed = 2;
        alien_defs[CD_SLAVETRANSPORT].maxShield = 10;
        alien_defs[CD_SLAVETRANSPORT].shield = 20;
-       alien_defs[CD_SLAVETRANSPORT].imageIndex[0] = 10;
-       alien_defs[CD_SLAVETRANSPORT].imageIndex[1] = 11;
+       alien_defs[CD_SLAVETRANSPORT].imageIndex[0] = SS_SLAVETRANSPORT;
+       alien_defs[CD_SLAVETRANSPORT].imageIndex[1] = SS_SLAVETRANSPORT_L;
        alien_defs[CD_SLAVETRANSPORT].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_SLAVETRANSPORT].weaponType[1] = W_DOUBLE_SHOT;
        alien_defs[CD_SLAVETRANSPORT].chance[0] = 0;
@@ -267,8 +267,8 @@ void alien_defs_init()
        alien_defs[CD_GOODTRANSPORT].speed = 3;
        alien_defs[CD_GOODTRANSPORT].maxShield = 75;
        alien_defs[CD_GOODTRANSPORT].shield = 75;
-       alien_defs[CD_GOODTRANSPORT].imageIndex[0] = 12;
-       alien_defs[CD_GOODTRANSPORT].imageIndex[1] = 13;
+       alien_defs[CD_GOODTRANSPORT].imageIndex[0] = SS_GOODTRANSPORT;
+       alien_defs[CD_GOODTRANSPORT].imageIndex[1] = SS_GOODTRANSPORT_L;
        alien_defs[CD_GOODTRANSPORT].weaponType[0] = W_AIMED_SHOT;
        alien_defs[CD_GOODTRANSPORT].weaponType[1] = W_AIMED_SHOT;
        alien_defs[CD_GOODTRANSPORT].chance[0] = 100;
@@ -284,8 +284,8 @@ void alien_defs_init()
        alien_defs[CD_SID].speed = 3;
        alien_defs[CD_SID].maxShield = 50;
        alien_defs[CD_SID].shield = 50;
-       alien_defs[CD_SID].imageIndex[0] = 24;
-       alien_defs[CD_SID].imageIndex[1] = 25;
+       alien_defs[CD_SID].imageIndex[0] = SS_SID;
+       alien_defs[CD_SID].imageIndex[1] = SS_SID_L;
        alien_defs[CD_SID].weaponType[0] = W_IONCANNON;
        alien_defs[CD_SID].weaponType[1] = W_IONCANNON;
        alien_defs[CD_SID].chance[0] = 100;
@@ -301,8 +301,8 @@ void alien_defs_init()
        alien_defs[CD_MINEBOSS].speed = 3;
        alien_defs[CD_MINEBOSS].maxShield = 1000;
        alien_defs[CD_MINEBOSS].shield = 1000;
-       alien_defs[CD_MINEBOSS].imageIndex[0] = 26;
-       alien_defs[CD_MINEBOSS].imageIndex[1] = 27;
+       alien_defs[CD_MINEBOSS].imageIndex[0] = SS_MINERBOSS;
+       alien_defs[CD_MINEBOSS].imageIndex[1] = SS_MINERBOSS_L;
        alien_defs[CD_MINEBOSS].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_MINEBOSS].weaponType[1] = W_SPREADSHOT;
        alien_defs[CD_MINEBOSS].chance[0] = 0;
@@ -317,8 +317,8 @@ void alien_defs_init()
        alien_defs[CD_BOSS2_WING1].speed = 1;
        alien_defs[CD_BOSS2_WING1].maxShield = 250;
        alien_defs[CD_BOSS2_WING1].shield = 250;
-       alien_defs[CD_BOSS2_WING1].imageIndex[0] = 28;
-       alien_defs[CD_BOSS2_WING1].imageIndex[1] = 29;
+       alien_defs[CD_BOSS2_WING1].imageIndex[0] = SS_MINERBOSS_WING1;
+       alien_defs[CD_BOSS2_WING1].imageIndex[1] = SS_MINERBOSS_WING1_L;
        alien_defs[CD_BOSS2_WING1].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_BOSS2_WING1].weaponType[1] = W_SPREADSHOT;
        alien_defs[CD_BOSS2_WING1].chance[0] = 0;
@@ -333,8 +333,8 @@ void alien_defs_init()
        alien_defs[CD_BOSS2_WING2].speed = 1;
        alien_defs[CD_BOSS2_WING2].maxShield = 500;
        alien_defs[CD_BOSS2_WING2].shield = 500;
-       alien_defs[CD_BOSS2_WING2].imageIndex[0] = 30;
-       alien_defs[CD_BOSS2_WING2].imageIndex[1] = 31;
+       alien_defs[CD_BOSS2_WING2].imageIndex[0] = SS_MINERBOSS_WING2;
+       alien_defs[CD_BOSS2_WING2].imageIndex[1] = SS_MINERBOSS_WING2_L;
        alien_defs[CD_BOSS2_WING2].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_BOSS2_WING2].weaponType[1] = W_SPREADSHOT;
        alien_defs[CD_BOSS2_WING2].chance[0] = 0;
@@ -349,8 +349,8 @@ void alien_defs_init()
        alien_defs[CD_BOSS2_WING3].speed = 1;
        alien_defs[CD_BOSS2_WING3].maxShield = 500;
        alien_defs[CD_BOSS2_WING3].shield = 500;
-       alien_defs[CD_BOSS2_WING3].imageIndex[0] = 32;
-       alien_defs[CD_BOSS2_WING3].imageIndex[1] = 33;
+       alien_defs[CD_BOSS2_WING3].imageIndex[0] = SS_MINERBOSS_WING3;
+       alien_defs[CD_BOSS2_WING3].imageIndex[1] = SS_MINERBOSS_WING3_L;
        alien_defs[CD_BOSS2_WING3].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_BOSS2_WING3].weaponType[1] = W_SPREADSHOT;
        alien_defs[CD_BOSS2_WING3].chance[0] = 0;
@@ -365,8 +365,8 @@ void alien_defs_init()
        alien_defs[CD_BOSS2_WING4].speed = 1;
        alien_defs[CD_BOSS2_WING4].maxShield = 250;
        alien_defs[CD_BOSS2_WING4].shield = 250;
-       alien_defs[CD_BOSS2_WING4].imageIndex[0] = 34;
-       alien_defs[CD_BOSS2_WING4].imageIndex[1] = 35;
+       alien_defs[CD_BOSS2_WING4].imageIndex[0] = SS_MINERBOSS_WING4;
+       alien_defs[CD_BOSS2_WING4].imageIndex[1] = SS_MINERBOSS_WING4_L;
        alien_defs[CD_BOSS2_WING4].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_BOSS2_WING4].weaponType[1] = W_SPREADSHOT;
        alien_defs[CD_BOSS2_WING4].chance[0] = 0;
@@ -382,8 +382,8 @@ void alien_defs_init()
        alien_defs[CD_DRONE].speed = 8;
        alien_defs[CD_DRONE].maxShield = 5;
        alien_defs[CD_DRONE].shield = 5;
-       alien_defs[CD_DRONE].imageIndex[0] = 36;
-       alien_defs[CD_DRONE].imageIndex[1] = 37;
+       alien_defs[CD_DRONE].imageIndex[0] = SS_DRONE;
+       alien_defs[CD_DRONE].imageIndex[1] = SS_DRONE_L;
        alien_defs[CD_DRONE].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_DRONE].weaponType[1] = W_LASER;
        alien_defs[CD_DRONE].chance[0] = 100;
@@ -399,8 +399,8 @@ void alien_defs_init()
        alien_defs[CD_CLOAKFIGHTER].speed = 6;
        alien_defs[CD_CLOAKFIGHTER].maxShield = 1000;
        alien_defs[CD_CLOAKFIGHTER].shield = 1000;
-       alien_defs[CD_CLOAKFIGHTER].imageIndex[0] = 10;
-       alien_defs[CD_CLOAKFIGHTER].imageIndex[1] = 11;
+       alien_defs[CD_CLOAKFIGHTER].imageIndex[0] = SS_CLOAKFIGHTER;
+       alien_defs[CD_CLOAKFIGHTER].imageIndex[1] = SS_CLOAKFIGHTER_L;
        alien_defs[CD_CLOAKFIGHTER].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_CLOAKFIGHTER].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_CLOAKFIGHTER].chance[0] = 100;
@@ -416,8 +416,8 @@ void alien_defs_init()
        alien_defs[CD_EVILURSULA].speed = 5;
        alien_defs[CD_EVILURSULA].maxShield = 500;
        alien_defs[CD_EVILURSULA].shield = 500;
-       alien_defs[CD_EVILURSULA].imageIndex[0] = 12;
-       alien_defs[CD_EVILURSULA].imageIndex[1] = 13;
+       alien_defs[CD_EVILURSULA].imageIndex[0] = SS_EVILURSULA;
+       alien_defs[CD_EVILURSULA].imageIndex[1] = SS_EVILURSULA_L;
        alien_defs[CD_EVILURSULA].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_EVILURSULA].weaponType[1] = W_HOMING_MISSILE;
        alien_defs[CD_EVILURSULA].chance[0] = 100;
@@ -433,8 +433,8 @@ void alien_defs_init()
        alien_defs[CD_KRASS].speed = 5;
        alien_defs[CD_KRASS].maxShield = 1000;
        alien_defs[CD_KRASS].shield = 1000;
-       alien_defs[CD_KRASS].imageIndex[0] = 26;
-       alien_defs[CD_KRASS].imageIndex[1] = 27;
+       alien_defs[CD_KRASS].imageIndex[0] = SS_KRASS;
+       alien_defs[CD_KRASS].imageIndex[1] = SS_KRASS_L;
        alien_defs[CD_KRASS].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_KRASS].weaponType[1] = W_CHARGER;
        alien_defs[CD_KRASS].chance[0] = 100;
@@ -446,12 +446,12 @@ void alien_defs_init()
 
        // Executive Transport
        alien_defs[CD_EXEC].classDef = CD_BOSS;
-       alien_defs[CD_EXEC].AIType = AI_NORMAL;
+       alien_defs[CD_EXEC].AIType = AI_EVASIVE;
        alien_defs[CD_EXEC].speed = 5;
        alien_defs[CD_EXEC].maxShield = 1000;
        alien_defs[CD_EXEC].shield = 1000;
-       alien_defs[CD_EXEC].imageIndex[0] = 28;
-       alien_defs[CD_EXEC].imageIndex[1] = 28;
+       alien_defs[CD_EXEC].imageIndex[0] = SS_EXEC;
+       alien_defs[CD_EXEC].imageIndex[1] = SS_EXEC_L;
        alien_defs[CD_EXEC].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_EXEC].weaponType[1] = W_HOMING_MISSILE;
        alien_defs[CD_EXEC].chance[0] = 0;
@@ -467,8 +467,8 @@ void alien_defs_init()
        alien_defs[CD_ASTEROID].speed = 1;
        alien_defs[CD_ASTEROID].maxShield = 50;
        alien_defs[CD_ASTEROID].shield = 50;
-       alien_defs[CD_ASTEROID].imageIndex[0] = 38;
-       alien_defs[CD_ASTEROID].imageIndex[1] = 38;
+       alien_defs[CD_ASTEROID].imageIndex[0] = SS_ASTEROID;
+       alien_defs[CD_ASTEROID].imageIndex[1] = SS_ASTEROID;
        alien_defs[CD_ASTEROID].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_ASTEROID].weaponType[1] = W_HOMING_MISSILE;
        alien_defs[CD_ASTEROID].chance[0] = 0;
@@ -483,8 +483,8 @@ void alien_defs_init()
        alien_defs[CD_ASTEROID2].speed = 1;
        alien_defs[CD_ASTEROID2].maxShield = 10;
        alien_defs[CD_ASTEROID2].shield = 10;
-       alien_defs[CD_ASTEROID2].imageIndex[0] = 39;
-       alien_defs[CD_ASTEROID2].imageIndex[1] = 40;
+       alien_defs[CD_ASTEROID2].imageIndex[0] = SS_ASTEROID_SMALL;
+       alien_defs[CD_ASTEROID2].imageIndex[1] = SS_ASTEROID_SMALL_L;
        alien_defs[CD_ASTEROID2].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_ASTEROID2].weaponType[1] = W_HOMING_MISSILE;
        alien_defs[CD_ASTEROID2].chance[0] = 0;
@@ -500,8 +500,8 @@ void alien_defs_init()
        alien_defs[CD_ESCORT].speed = 3;
        alien_defs[CD_ESCORT].maxShield = 200;
        alien_defs[CD_ESCORT].shield = 200;
-       alien_defs[CD_ESCORT].imageIndex[0] = 30;
-       alien_defs[CD_ESCORT].imageIndex[1] = 31;
+       alien_defs[CD_ESCORT].imageIndex[0] = SS_ESCORT;
+       alien_defs[CD_ESCORT].imageIndex[1] = SS_ESCORT_L;
        alien_defs[CD_ESCORT].weaponType[0] = W_LASER;
        alien_defs[CD_ESCORT].weaponType[1] = W_LASER;
        alien_defs[CD_ESCORT].chance[0] = 25;
@@ -517,12 +517,12 @@ void alien_defs_init()
        alien_defs[CD_MOBILE_RAY].speed = 5;
        alien_defs[CD_MOBILE_RAY].maxShield = 250;
        alien_defs[CD_MOBILE_RAY].shield = 250;
-       alien_defs[CD_MOBILE_RAY].imageIndex[0] = 10;
-       alien_defs[CD_MOBILE_RAY].imageIndex[1] = 11;
+       alien_defs[CD_MOBILE_RAY].imageIndex[0] = SS_MOBILE_RAY;
+       alien_defs[CD_MOBILE_RAY].imageIndex[1] = SS_MOBILE_RAY_L;
        alien_defs[CD_MOBILE_RAY].weaponType[0] = W_ENERGYRAY;
        alien_defs[CD_MOBILE_RAY].weaponType[1] = W_ENERGYRAY;
        alien_defs[CD_MOBILE_RAY].chance[0] = 50;
-       alien_defs[CD_MOBILE_RAY].chance[1] = 50;
+       alien_defs[CD_MOBILE_RAY].chance[1] = 0;
        alien_defs[CD_MOBILE_RAY].collectChance = 75;
        alien_defs[CD_MOBILE_RAY].collectType = P_ANYTHING;
        alien_defs[CD_MOBILE_RAY].collectValue = 100;
@@ -534,8 +534,8 @@ void alien_defs_init()
        alien_defs[CD_REBELCARRIER].speed = 2;
        alien_defs[CD_REBELCARRIER].maxShield = 100;
        alien_defs[CD_REBELCARRIER].shield = 100;
-       alien_defs[CD_REBELCARRIER].imageIndex[0] = 32;
-       alien_defs[CD_REBELCARRIER].imageIndex[1] = 33;
+       alien_defs[CD_REBELCARRIER].imageIndex[0] = SS_REBELCARRIER;
+       alien_defs[CD_REBELCARRIER].imageIndex[1] = SS_REBELCARRIER_L;
        alien_defs[CD_REBELCARRIER].weaponType[0] = W_DOUBLE_ROCKETS;
        alien_defs[CD_REBELCARRIER].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_REBELCARRIER].chance[0] = 50;
@@ -551,8 +551,8 @@ void alien_defs_init()
        alien_defs[CD_PLUTOBOSS].speed = 4;
        alien_defs[CD_PLUTOBOSS].maxShield = 500;
        alien_defs[CD_PLUTOBOSS].shield = 500;
-       alien_defs[CD_PLUTOBOSS].imageIndex[0] = 12;
-       alien_defs[CD_PLUTOBOSS].imageIndex[1] = 13;
+       alien_defs[CD_PLUTOBOSS].imageIndex[0] = SS_PLUTOBOSS;
+       alien_defs[CD_PLUTOBOSS].imageIndex[1] = SS_PLUTOBOSS_L;
        alien_defs[CD_PLUTOBOSS].weaponType[0] = W_DOUBLE_ROCKETS;
        alien_defs[CD_PLUTOBOSS].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_PLUTOBOSS].chance[0] = 50;
@@ -568,8 +568,8 @@ void alien_defs_init()
        alien_defs[CD_BARRIER].speed = 1;
        alien_defs[CD_BARRIER].maxShield = 250;
        alien_defs[CD_BARRIER].shield = 250;
-       alien_defs[CD_BARRIER].imageIndex[0] = 32;
-       alien_defs[CD_BARRIER].imageIndex[1] = 33;
+       alien_defs[CD_BARRIER].imageIndex[0] = SS_BARRIER;
+       alien_defs[CD_BARRIER].imageIndex[1] = SS_BARRIER;
        alien_defs[CD_BARRIER].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_BARRIER].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_BARRIER].chance[0] = 0;
@@ -585,8 +585,8 @@ void alien_defs_init()
        alien_defs[CD_NEPTUNEBOSS].speed = 4;
        alien_defs[CD_NEPTUNEBOSS].maxShield = 800;
        alien_defs[CD_NEPTUNEBOSS].shield = 800;
-       alien_defs[CD_NEPTUNEBOSS].imageIndex[0] = 12;
-       alien_defs[CD_NEPTUNEBOSS].imageIndex[1] = 13;
+       alien_defs[CD_NEPTUNEBOSS].imageIndex[0] = SS_PLUTOBOSS;
+       alien_defs[CD_NEPTUNEBOSS].imageIndex[1] = SS_PLUTOBOSS_L;
        alien_defs[CD_NEPTUNEBOSS].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_NEPTUNEBOSS].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_NEPTUNEBOSS].chance[0] = 100;
@@ -602,8 +602,8 @@ void alien_defs_init()
        alien_defs[CD_MOBILESHIELD].speed = 6;
        alien_defs[CD_MOBILESHIELD].maxShield = 150;
        alien_defs[CD_MOBILESHIELD].shield = 150;
-       alien_defs[CD_MOBILESHIELD].imageIndex[0] = 34;
-       alien_defs[CD_MOBILESHIELD].imageIndex[1] = 35;
+       alien_defs[CD_MOBILESHIELD].imageIndex[0] = SS_MOBILESHIELD;
+       alien_defs[CD_MOBILESHIELD].imageIndex[1] = SS_MOBILESHIELD_L;
        alien_defs[CD_MOBILESHIELD].weaponType[0] = W_DOUBLE_SHOT;
        alien_defs[CD_MOBILESHIELD].weaponType[1] = W_MICRO_ROCKETS;
        alien_defs[CD_MOBILESHIELD].chance[0] = 0;
@@ -619,8 +619,8 @@ void alien_defs_init()
        alien_defs[CD_FIREFLY].speed = 5;
        alien_defs[CD_FIREFLY].maxShield = 250;
        alien_defs[CD_FIREFLY].shield = 250;
-       alien_defs[CD_FIREFLY].imageIndex[0] = 0;
-       alien_defs[CD_FIREFLY].imageIndex[1] = 1;
+       alien_defs[CD_FIREFLY].imageIndex[0] = SS_FIREFLY;
+       alien_defs[CD_FIREFLY].imageIndex[1] = SS_FIREFLY_L;
        alien_defs[CD_FIREFLY].weaponType[0] = W_TRIPLE_SHOT;
        alien_defs[CD_FIREFLY].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_FIREFLY].chance[0] = 100;
@@ -636,8 +636,8 @@ void alien_defs_init()
        alien_defs[CD_URANUSBOSS].speed = 4;
        alien_defs[CD_URANUSBOSS].maxShield = 750;
        alien_defs[CD_URANUSBOSS].shield = 750;
-       alien_defs[CD_URANUSBOSS].imageIndex[0] = 41;
-       alien_defs[CD_URANUSBOSS].imageIndex[1] = 42;
+       alien_defs[CD_URANUSBOSS].imageIndex[0] = SS_URANUSBOSS;
+       alien_defs[CD_URANUSBOSS].imageIndex[1] = SS_URANUSBOSS_L;
        alien_defs[CD_URANUSBOSS].weaponType[0] = W_SPREADSHOT;
        alien_defs[CD_URANUSBOSS].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_URANUSBOSS].chance[0] = 100;
@@ -653,8 +653,8 @@ void alien_defs_init()
        alien_defs[CD_URANUSBOSSWING1].speed = 4;
        alien_defs[CD_URANUSBOSSWING1].maxShield = 250;
        alien_defs[CD_URANUSBOSSWING1].shield = 250;
-       alien_defs[CD_URANUSBOSSWING1].imageIndex[0] = 43;
-       alien_defs[CD_URANUSBOSSWING1].imageIndex[1] = 44;
+       alien_defs[CD_URANUSBOSSWING1].imageIndex[0] = SS_URANUSBOSS_WING1;
+       alien_defs[CD_URANUSBOSSWING1].imageIndex[1] = SS_URANUSBOSS_WING1_L;
        alien_defs[CD_URANUSBOSSWING1].weaponType[0] = W_DOUBLE_ROCKETS;
        alien_defs[CD_URANUSBOSSWING1].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_URANUSBOSSWING1].chance[0] = 5;
@@ -670,8 +670,8 @@ void alien_defs_init()
        alien_defs[CD_URANUSBOSSWING2].speed = 4;
        alien_defs[CD_URANUSBOSSWING2].maxShield = 250;
        alien_defs[CD_URANUSBOSSWING2].shield = 250;
-       alien_defs[CD_URANUSBOSSWING2].imageIndex[0] = 45;
-       alien_defs[CD_URANUSBOSSWING2].imageIndex[1] = 46;
+       alien_defs[CD_URANUSBOSSWING2].imageIndex[0] = SS_URANUSBOSS_WING2;
+       alien_defs[CD_URANUSBOSSWING2].imageIndex[1] = SS_URANUSBOSS_WING2_L;
        alien_defs[CD_URANUSBOSSWING2].weaponType[0] = W_DOUBLE_ROCKETS;
        alien_defs[CD_URANUSBOSSWING2].weaponType[1] = W_DOUBLE_ROCKETS;
        alien_defs[CD_URANUSBOSSWING2].chance[0] = 5;
@@ -684,13 +684,12 @@ void alien_defs_init()
 
 void aliens_init()
 {
-       FILE *fp;
-       char string[255];
-       int index;
-       int alienType;
        int placeAttempt;
        int barrierSpeed;
 
+       engine.targetIndex = -1;
+       barrierSpeed = 1;
+
        for (int i = 0 ; i < ALIEN_MAX ; i++)
        {
                aliens[i].active = false;
@@ -698,25 +697,166 @@ void aliens_init()
                aliens[i].flags = 0;
        }
 
-       engine.targetIndex = -1;
+       switch (game.area)
+       {
+               case MISN_START:
+                       aliens[0] = alien_defs[CD_TRANSPORTSHIP];
+                       break;
 
-       strcpy(string, "");
-       barrierSpeed = 1;
+               case MISN_CERADSE:
+                       aliens[0] = alien_defs[CD_CARGOSHIP];
+                       aliens[1] = alien_defs[CD_CARGOSHIP];
+                       aliens[2] = alien_defs[CD_CARGOSHIP];
+                       aliens[3] = alien_defs[CD_CARGOSHIP];
+                       aliens[4] = alien_defs[CD_CARGOSHIP];
+                       aliens[5] = alien_defs[CD_CARGOSHIP];
+                       break;
+
+               case MISN_HINSTAG:
+                       aliens[0] = alien_defs[CD_MISSILEBOAT];
+                       aliens[1] = alien_defs[CD_MISSILEBOAT];
+                       aliens[2] = alien_defs[CD_MISSILEBOAT];
+                       aliens[3] = alien_defs[CD_MISSILEBOAT];
+                       aliens[4] = alien_defs[CD_MISSILEBOAT];
+                       break;
+
+               case MISN_JOLDAR:
+                       aliens[0] = alien_defs[CD_MINER];
+                       aliens[1] = alien_defs[CD_MINER];
+                       aliens[2] = alien_defs[CD_MINER];
+                       aliens[3] = alien_defs[CD_MINER];
+                       aliens[4] = alien_defs[CD_MINER];
+                       aliens[5] = alien_defs[CD_MINER];
+                       aliens[6] = alien_defs[CD_MINER];
+                       aliens[7] = alien_defs[CD_MINER];
+                       aliens[8] = alien_defs[CD_MINER];
+                       break;
+
+               case MISN_MOEBO:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_FRIGATE];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_FRIGATE_WING1];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_FRIGATE_WING2];
+                       break;
+
+               case MISN_NEROD:
+                       aliens[0] = alien_defs[CD_CARGOSHIP];
+                       break;
+
+               case MISN_ALLEZ:
+                       aliens[ALIEN_FRIEND1] = alien_defs[CD_GOODTRANSPORT];
+                       break;
+
+               case MISN_URUSOR:
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_CARGOSHIP];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_CARGOSHIP];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_CARGOSHIP];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_CARGOSHIP];
+                       aliens[ALIEN_BOSS_PART5] = alien_defs[CD_CARGOSHIP];
+                       break;
+
+               case MISN_ELAMALE:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_MINEBOSS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_BOSS2_WING1];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BOSS2_WING2];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
+                       aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
+                       aliens[ALIEN_BOSS_PART5] = alien_defs[CD_SLAVETRANSPORT];
+                       aliens[ALIEN_BOSS_PART6] = alien_defs[CD_SLAVETRANSPORT];
+                       break;
+
+               case MISN_ODEON:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_EVILURSULA];
+                       break;
+
+               case MISN_FELLON:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_MINEBOSS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_BOSS2_WING1];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BOSS2_WING2];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
+                       aliens[ALIEN_FRIEND1] = alien_defs[CD_REBELCARRIER];
+                       aliens[ALIEN_FRIEND2] = alien_defs[CD_REBELCARRIER];
+                       break;
+
+               case MISN_ALMARTHA:
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_CLOAKFIGHTER];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_CLOAKFIGHTER];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_CLOAKFIGHTER];
+                       aliens[ALIEN_FRIEND1] = alien_defs[CD_KRASS];
+                       break;
+
+               case MISN_POSWIC:
+                       aliens[0] = alien_defs[CD_ESCORT];
+                       aliens[1] = alien_defs[CD_ESCORT];
+                       aliens[2] = alien_defs[CD_ESCORT];
+                       aliens[3] = alien_defs[CD_ESCORT];
+                       aliens[4] = alien_defs[CD_ESCORT];
+                       aliens[ALIEN_BOSS] = alien_defs[CD_EXEC];
+                       break;
+
+               case MISN_ELLESH:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_EXEC];
+                       break;
+
+               case MISN_PLUTO:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_PLUTOBOSS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_BARRIER];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BARRIER];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BARRIER];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BARRIER];
+                       aliens[ALIEN_BOSS_PART5] = alien_defs[CD_BARRIER];
+                       aliens[ALIEN_BOSS_PART6] = alien_defs[CD_BARRIER];
+                       break;
+
+               case MISN_NEPTUNE:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_NEPTUNEBOSS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_MOBILESHIELD];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_MOBILESHIELD];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_MOBILESHIELD];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_MOBILESHIELD];
+                       aliens[ALIEN_BOSS_PART5] = alien_defs[CD_MOBILESHIELD];
+                       break;
+
+               case MISN_URANUS:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_URANUSBOSS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_URANUSBOSSWING1];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_URANUSBOSSWING2];
+                       break;
 
-       sprintf(string, "data/aliens%d.dat", game.area);
-       fp = fopen(string, "rb");
+               case MISN_SATURN:
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_MOBILE_RAY];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_MOBILE_RAY];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_MOBILE_RAY];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_MOBILE_RAY];
+                       aliens[ALIEN_BOSS_PART5] = alien_defs[CD_MOBILE_RAY];
+                       aliens[ALIEN_BOSS_PART6] = alien_defs[CD_MOBILE_RAY];
+                       break;
+
+               case MISN_JUPITER:
+                       aliens[ALIEN_BOSS] = alien_defs[CD_KRASS];
+                       aliens[ALIEN_BOSS_PART1] = alien_defs[CD_FIREFLY];
+                       aliens[ALIEN_BOSS_PART2] = alien_defs[CD_FIREFLY];
+                       aliens[ALIEN_BOSS_PART3] = alien_defs[CD_FIREFLY];
+                       aliens[ALIEN_BOSS_PART4] = alien_defs[CD_FIREFLY];
+                       break;
 
-       if (fp != NULL)
+               case MISN_EARTH:
+               case MISN_VENUS:
+                       aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
+                       break;
+       }
+
+       for (int i = 0 ; i < ALIEN_MAX ; i++)
        {
-               while (fscanf(fp, "%d %d ", &index, &alienType) == 2)
+               if (aliens[i].shield != -1)
                {
                        placeAttempt = 0;
 
-                       aliens[index] = alien_defs[alienType];
-                       aliens[index].owner = &aliens[index];
-                       aliens[index].target = &aliens[index];
-                       aliens[index].face = rand() % 2;
-                       aliens[index].active = true;
+                       aliens[i].owner = &aliens[i];
+                       aliens[i].target = &aliens[i];
+                       aliens[i].face = rand() % 2;
+                       aliens[i].active = true;
 
                        /*
                        we make 1000 attempts to place this enemy since it is required. If after
@@ -728,137 +868,125 @@ void aliens_init()
                        {
                                placeAttempt++;
 
-                               if (alien_place(&aliens[index]))
+                               if (alien_place(&aliens[i]))
                                        break;
 
                                if (placeAttempt > 1000)
-                                       showErrorAndExit(2, "");
+                                       engine_showError(2, "");
                        }
 
                        if (game.area == MISN_CERADSE)
-                               cargo_add(&aliens[index], P_CARGO);
+                               cargo_add(&aliens[i], P_CARGO);
                        else if (game.area == MISN_NEROD)
-                               cargo_add(&aliens[index], P_PHOEBE);
+                               cargo_add(&aliens[i], P_PHOEBE);
 
-                       if (index == ALIEN_KLINE)
+                       if (i == ALIEN_KLINE)
                        {
                                aliens[ALIEN_KLINE].target = &player;
                        }
 
-                       if (aliens[index].classDef == CD_CLOAKFIGHTER)
+                       if (aliens[i].classDef == CD_CLOAKFIGHTER)
                        {
-                               aliens[index].active = false;
-                               aliens[index].maxShield = aliens[index].shield = 400;
-                               aliens[index].flags &= ~FL_RUNSAWAY;
-                               aliens[index].speed = 3;
+                               aliens[i].active = false;
+                               aliens[i].maxShield = aliens[i].shield = 400;
+                               aliens[i].flags &= ~FL_RUNSAWAY;
+                               aliens[i].speed = 3;
                        }
 
-                       if ((aliens[index].classDef == CD_MOBILE_RAY) && (index >= 11))
+                       if ((aliens[i].classDef == CD_MOBILE_RAY) && (i >= ALIEN_BOSS_PART3))
                        {
-                               aliens[index].active = false;
+                               aliens[i].active = false;
                        }
 
-                       if (aliens[index].classDef == CD_FIREFLY)
+                       if (aliens[i].classDef == CD_FIREFLY)
                        {
-                               aliens[index].active = false;
+                               aliens[i].active = false;
                        }
 
-                       if (aliens[index].classDef == CD_BARRIER)
+                       if (aliens[i].classDef == CD_BARRIER)
                        {
-                               aliens[index].owner = &aliens[ALIEN_BOSS];
-                               aliens[index].speed = barrierSpeed;
+                               aliens[i].owner = &aliens[ALIEN_BOSS];
+                               aliens[i].speed = barrierSpeed;
                                barrierSpeed++;
                        }
 
                        if ((game.area == MISN_POSWIC) &&
-                               (aliens[index].classDef == CD_BOSS))
+                               (aliens[i].classDef == CD_BOSS))
                        {
-                               aliens[index].imageIndex[1] = 29;
-                               aliens[index].flags |= FL_IMMORTAL;
+                               aliens[i].flags |= FL_IMMORTAL;
                        }
 
                        if (game.area == MISN_ELLESH)
-                               aliens[index].flags |= FL_HASMINIMUMSPEED;
+                               aliens[i].flags |= FL_HASMINIMUMSPEED;
 
                        if (game.area == MISN_JUPITER)
                        {
-                               aliens[index].flags = FL_WEAPCO;
-                               if (index == ALIEN_BOSS)
-                                       aliens[index].chance[1] = 5;
+                               aliens[i].flags = FL_WEAPCO;
+                               if (i == ALIEN_BOSS)
+                                       aliens[i].chance[1] = 5;
                        }
                }
+       }
 
-               fclose(fp);
-
-               if (game.area == MISN_MOEBO)
-               {
-                       aliens[ALIEN_BOSS].target = &player;
-                       aliens[ALIEN_BOSS].x = -screen->w / 2;
-                       aliens[ALIEN_BOSS].y = screen->h / 2;
-
-                       aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART1].target = &player;
-                       aliens[ALIEN_BOSS_PART1].dx = -25;
-                       aliens[ALIEN_BOSS_PART1].dy = -21;
-
-                       aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART2].target = &player;
-                       aliens[ALIEN_BOSS_PART2].dx = -20;
-                       aliens[ALIEN_BOSS_PART2].dy = 37;
-               }
-               else if ((game.area == MISN_ELAMALE) ||
-                       (game.area == MISN_FELLON))
+       if (game.area == MISN_MOEBO)
+       {
+               aliens[ALIEN_BOSS].target = &player;
+               aliens[ALIEN_BOSS].x = -screen->w / 2;
+               aliens[ALIEN_BOSS].y = screen->h / 2;
+
+               aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART1].target = &player;
+               aliens[ALIEN_BOSS_PART1].dx = -25;
+               aliens[ALIEN_BOSS_PART1].dy = -21;
+
+               aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART2].target = &player;
+               aliens[ALIEN_BOSS_PART2].dx = -20;
+               aliens[ALIEN_BOSS_PART2].dy = 37;
+       }
+       else if ((game.area == MISN_ELAMALE) ||
+               (game.area == MISN_FELLON))
+       {
+               aliens[ALIEN_BOSS].target = &player;
+               aliens[ALIEN_BOSS].x = -screen->w / 2;
+               aliens[ALIEN_BOSS].y = screen->h / 2;
+
+               aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS_PART2];
+               aliens[ALIEN_BOSS_PART1].target = &player;
+               aliens[ALIEN_BOSS_PART1].dx = -35;
+               aliens[ALIEN_BOSS_PART1].dy = -12;
+
+               aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART2].target = &player;
+               aliens[ALIEN_BOSS_PART2].dx = 15;
+               aliens[ALIEN_BOSS_PART2].dy = -22;
+
+               aliens[ALIEN_BOSS_PART3].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART3].target = &player;
+               aliens[ALIEN_BOSS_PART3].dx = 15;
+               aliens[ALIEN_BOSS_PART3].dy = 22;
+
+               aliens[ALIEN_BOSS_PART4].owner = &aliens[ALIEN_BOSS_PART3];
+               aliens[ALIEN_BOSS_PART4].target = &player;
+               aliens[ALIEN_BOSS_PART4].dx = -35;
+               aliens[ALIEN_BOSS_PART4].dy = 20;
+
+               if (game.area == MISN_FELLON)
                {
-                       aliens[ALIEN_BOSS].target = &player;
-                       aliens[ALIEN_BOSS].x = -screen->w / 2;
-                       aliens[ALIEN_BOSS].y = screen->h / 2;
-
-                       aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART1].target = &player;
-                       aliens[ALIEN_BOSS_PART1].dx = 15;
-                       aliens[ALIEN_BOSS_PART1].dy = -22;
-
-                       aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART2].target = &player;
-                       aliens[ALIEN_BOSS_PART2].dx = 15;
-                       aliens[ALIEN_BOSS_PART2].dy = 22;
-
-                       aliens[ALIEN_BOSS_PART3].owner = &aliens[ALIEN_BOSS_PART1];
-                       aliens[ALIEN_BOSS_PART3].target = &player;
-                       aliens[ALIEN_BOSS_PART3].dx = -35;
-                       aliens[ALIEN_BOSS_PART3].dy = -12;
-
-                       aliens[ALIEN_BOSS_PART4].owner = &aliens[ALIEN_BOSS_PART2];
-                       aliens[ALIEN_BOSS_PART4].target = &player;
-                       aliens[ALIEN_BOSS_PART4].dx = -35;
-                       aliens[ALIEN_BOSS_PART4].dy = 20;
-
-                       if (game.area == MISN_FELLON)
-                       {
-                               aliens[ALIEN_BOSS].AIType = AI_EVASIVE;
-
-                               for (int i = 10 ; i < 15 ; i++)
-                               {
-                                       aliens[i].imageIndex[0] += 15;
-                                       aliens[i].imageIndex[1] += 15;
-
-                                       aliens[i].image[0] = shipShape[aliens[i].imageIndex[0]];
-                                       aliens[i].image[1] = shipShape[aliens[i].imageIndex[1]];
-                               }
-                       }
+                       aliens[ALIEN_BOSS].AIType = AI_EVASIVE;
                }
-               else if (game.area == MISN_URANUS)
-               {
-                       aliens[ALIEN_BOSS].target = &player;
-                       aliens[ALIEN_BOSS].x = -screen->w / 2;
-                       aliens[ALIEN_BOSS].y = screen->h / 2;
+       }
+       else if (game.area == MISN_URANUS)
+       {
+               aliens[ALIEN_BOSS].target = &player;
+               aliens[ALIEN_BOSS].x = -screen->w / 2;
+               aliens[ALIEN_BOSS].y = screen->h / 2;
 
-                       aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART1].dy = 20;
+               aliens[ALIEN_BOSS_PART1].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART1].dy = -16;
 
-                       aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
-                       aliens[ALIEN_BOSS_PART2].dy = -16;
-               }
+               aliens[ALIEN_BOSS_PART2].owner = &aliens[ALIEN_BOSS];
+               aliens[ALIEN_BOSS_PART2].dy = 20;
        }
 }
 
@@ -870,10 +998,10 @@ bool alien_add()
                        (game.area == MISN_VENUS))
                return 0;
 
-       signed char *alienArray;
-       signed char numberOfAliens = 1;
+       int *alienArray;
+       int numberOfAliens = 1;
 
-       alienArray = new signed char[8];
+       alienArray = new int[8];
 
        switch(game.area)
        {
@@ -908,6 +1036,14 @@ bool alien_add()
                        numberOfAliens = 2;
                        alienArray[0] = CD_PROTOFIGHTER;
                        alienArray[1] = CD_AIMFIGHTER;
+                       // ...That is, unless we're in Classic difficulty, because
+                       // the original game actually had these enemies.
+                       if (game.difficulty == DIFFICULTY_ORIGINAL)
+                       {
+                               numberOfAliens = 4;
+                               alienArray[2] = CD_DUALFIGHTER;
+                               alienArray[3] = CD_MISSILEBOAT;
+                       }
                        break;
                case MISN_DORIM:
                case MISN_SIVEDI:
@@ -948,14 +1084,18 @@ bool alien_add()
                        alienArray[5] = CD_MOBILE_RAY;
                        break;
                case MISN_INTERCEPTION:
-                       numberOfAliens = 3;
+                       numberOfAliens = 1;
                        alienArray[0] = CD_DUALFIGHTER;
-                       alienArray[1] = CD_MISSILEBOAT;
-                       alienArray[2] = CD_AIMFIGHTER;
-                       if (game.system == 2)
+                       if (game.system > SYSTEM_SPIRIT)
                        {
-                               numberOfAliens = 4;
-                               alienArray[3] = CD_PROTOFIGHTER;
+                               numberOfAliens = 3;
+                               alienArray[1] = CD_MISSILEBOAT;
+                               alienArray[2] = CD_AIMFIGHTER;
+                               if (game.system == SYSTEM_MORDOR)
+                               {
+                                       numberOfAliens = 4;
+                                       alienArray[3] = CD_PROTOFIGHTER;
+                               }
                        }
                        break;
                default:
@@ -964,13 +1104,13 @@ bool alien_add()
                        break;
        }
 
-       signed char randEnemy = alienArray[rand() % numberOfAliens];
+       int randEnemy = alienArray[rand() % numberOfAliens];
 
        if ((game.area != MISN_DORIM) &&
                (game.area != MISN_SIVEDI) &&
                (game.area != MISN_MARS))
        {
-               if ((game.system == 1) && (game.area == MISN_INTERCEPTION))
+               if ((game.system == SYSTEM_EYANANTH) && (game.area == MISN_INTERCEPTION))
                {
                        if ((rand() % 5) == 0)
                                randEnemy = CD_SLAVETRANSPORT;
@@ -1056,7 +1196,7 @@ void alien_addSmallAsteroid(object *hostAlien)
        for (int i = 0 ; i < debris ; i++)
                bullet_add(&weapon[W_ROCKETS], hostAlien, 0, 0);
 
-       for (int i = 10 ; i < 20 ; i++)
+       for (int i = 0 ; i <= ALIEN_NORMAL_LAST ; i++)
                if (!aliens[i].active)
                        index = i;
 
@@ -1066,9 +1206,10 @@ void alien_addSmallAsteroid(object *hostAlien)
        if ((rand() % 10) > 3)
        {
                aliens[index] = alien_defs[CD_ASTEROID2];
-               aliens[index].imageIndex[0] = aliens[index].imageIndex[1] = 39 + rand() % 2;
-               aliens[index].image[0] = shipShape[aliens[index].imageIndex[0]];
-               aliens[index].image[1] = shipShape[aliens[index].imageIndex[1]];
+               aliens[index].imageIndex[0] = RANDRANGE(SS_ASTEROID_SMALL, SS_ASTEROID_SMALL_L);
+               aliens[index].imageIndex[1] = aliens[index].imageIndex[0];
+               aliens[index].image[0] = gfx_shipSprites[aliens[index].imageIndex[0]];
+               aliens[index].image[1] = gfx_shipSprites[aliens[index].imageIndex[1]];
        }
        else
        {
@@ -1133,9 +1274,7 @@ bool alien_place(object *alien)
        {
                if ((aliens[i].owner != alien) && (aliens[i].shield > 0))
                {
-                       if (collision(alien->x, alien->y, alien->image[0]->w,
-                                       alien->image[0]->h, aliens[i].x, aliens[i].y,
-                                       aliens[i].image[0]->w, aliens[i].image[0]->h))
+                       if (ship_collision(alien, &aliens[i]))
                                return false;
                }
        }
@@ -1145,10 +1284,19 @@ bool alien_place(object *alien)
 
 void alien_setAI(object *alien)
 {
+       int i;
+       float tx;
+       float ty;
+
+       int chase = 0; // Chance in 10 of chasing player
+       int area = 0; // Chance in 10 of moving to an area around the player
+       int stop = 0; // Chance in 10 of hanging back
+       int point = 0; // Size of area alien will move into
+
        // Make friendly craft generally concentrate on smaller fighters
        if ((alien->flags & FL_FRIEND) && (alien->target == &aliens[ALIEN_BOSS]))
        {
-               if ((rand() % 5) == 0)
+               if (CHANCE(0.2))
                {
                        alien->target = alien;
                        alien->thinktime = 0;
@@ -1156,14 +1304,9 @@ void alien_setAI(object *alien)
                }
        }
 
-       int i = rand() % 10;
-       float tx = alien->target->x;
-       float ty = alien->target->y;
-
-       int chase = 0; // Chance in 10 of chasing player
-       int area = 0; // Chance in 10 of moving to an area around the player
-       int stop = 0; // Chance in 10 of hanging back
-       int point = 0; // Size of area alien will move into
+       i = rand() % 10;
+       tx = alien->target->x;
+       ty = alien->target->y;
 
        switch (alien->AIType)
        {
@@ -1209,8 +1352,8 @@ void alien_setAI(object *alien)
        else if ((i >= point) && (i <= stop))
        {
                // Fly to a random point around the target
-               tx += (rand() % area - (rand() % area * 2));
-               ty += (rand() % area - (rand() % area * 2));
+               tx += RANDRANGE(-area, area);
+               ty += RANDRANGE(-area, area);
                alien->dx = ((alien->x - tx) / ((300 / alien->speed) + rand() % 100));
                alien->dy = ((alien->y - ty) / ((300 / alien->speed) + rand() % 100));
                return;
@@ -1228,26 +1371,28 @@ void alien_setKlineAttackMethod(object *alien)
 {
        if (alien->shield <= 500)
        {
-               setRadioMessage(FACE_KLINE, "¤â¤¦¤è¤¤!! ¤³¤ì¤Ç½ª¤ï¤ê¤À!!!", 1);
+               setRadioMessage(FS_KLINE, "¤â¤¦¤è¤¤!! ¤³¤ì¤Ç½ª¤ï¤ê¤À!!!", 1);
                alien->weaponType[0] = W_AIMED_SHOT;
                alien->weaponType[1] = W_MICRO_HOMING_MISSILES;
                alien->flags |= FL_CANCLOAK;
                alien->chance[0] = 100;
                alien->chance[1] = 2;
-               alien->flags &= ~FL_CANNOTDIE;
        }
        else if (alien->shield <= 1000)
        {
-               setRadioMessage(FACE_KLINE, "¤¢¤­¤ì¤ë¤è¤¦¤Ê ¤·¤Ö¤È¤µ¤À! ¤³¤ì¤Ç¤â¿©¤é¤¨!!", 1);
-               alien->weaponType[0] = W_DIRSHOCKMISSILE;
+               setRadioMessage(FS_KLINE, "¤¢¤­¤ì¤ë¤è¤¦¤Ê ¤·¤Ö¤È¤µ¤À! ¤³¤ì¤Ç¤â¿©¤é¤¨!!", 1);
+               if (game.difficulty == DIFFICULTY_ORIGINAL)
+               {
+                       alien->weaponType[0] = W_DIRSHOCKMISSILE;
+                       alien->chance[0] = 2;
+               }
                alien->weaponType[1] = W_DIRSHOCKMISSILE;
-               alien->chance[0] = 2;
                alien->chance[1] = 2;
                alien->flags |= FL_AIMS;
        }
        else
        {
-               setRadioMessage(FACE_KLINE, "¤¹¤Ð¤é¤·¤¤¤¾¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¾¯¤·Ëܵ¤¤ò½Ð¤·¤Æ¤ä¤í¤¦¡Ä", 1);
+               setRadioMessage(FS_KLINE, "¤¹¤Ð¤é¤·¤¤¤¾¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¾¯¤·Ëܵ¤¤ò½Ð¤·¤Æ¤ä¤í¤¦¡Ä", 1);
                alien->weaponType[0] = W_SPREADSHOT;
                alien->chance[1] = 40;
        }
@@ -1259,16 +1404,19 @@ This AI is exclusively for Kline.
 void alien_setKlineAI(object *alien)
 {
        // Weapon type change
-       if ((rand() % 3) == 0)
+       if (CHANCE(1. / 3.))
        {
-               if (game.area != MISN_VENUS)
+               if ((game.area != MISN_VENUS) || (game.difficulty != DIFFICULTY_ORIGINAL))
                {
                        alien->flags &= ~FL_AIMS;
 
                        switch(rand() % 2)
                        {
                                case 0:
-                                       alien->weaponType[0] = W_TRIPLE_SHOT;
+                                       if ((game.area != MISN_VENUS) || (alien->shield > 1500))
+                                               alien->weaponType[0] = W_TRIPLE_SHOT;
+                                       else
+                                               alien->weaponType[0] = W_SPREADSHOT;
                                        break;
                                case 1:
                                        alien->weaponType[0] = W_AIMED_SHOT;
@@ -1293,9 +1441,10 @@ void alien_setKlineAI(object *alien)
                        break;
                case 1:
                case 2:
-                       // Kline only attacks then he is ready!
+                       // Kline only attacks when he is ready!
                        if ((!(alien->flags & FL_NOFIRE)) &&
-                                       (game.area == MISN_MOEBO))
+                                       ((game.area == MISN_MOEBO) ||
+                                               game.difficulty != DIFFICULTY_ORIGINAL))
                                alien->flags |= FL_DROPMINES;
                        break;
                case 3:
@@ -1485,7 +1634,7 @@ void alien_move(object *alien)
                                continue;
                        }
 
-                       if (collision(alien, &aliens[i]))
+                       if (ship_collision(alien, &aliens[i]))
                        {
                                if ((aliens[i].classDef == CD_BARRIER) &&
                                        (aliens[i].owner != alien))
@@ -1494,7 +1643,7 @@ void alien_move(object *alien)
                                        alien->hit = 3;
                                        alien->dx *= -1;
                                        alien->dy *= -1;
-                                       audio_playSound(SFX_HIT, alien->x);
+                                       audio_playSound(SFX_HIT, alien->x, alien->y);
                                }
                        }
                }
@@ -1503,34 +1652,34 @@ void alien_move(object *alien)
        // Handle a collision with the player
        if ((player.shield > 0) && (alien->shield > 0) && (checkCollisions))
        {
-               if (collision(alien, &player))
+               if (ship_collision(alien, &player))
                {
                        if (alien->classDef == CD_ASTEROID)
                        {
-                               if (!engine.cheatShield)
+                               if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0))
                                        player.shield -= alien->shield;
                                alien->shield = 0;
-                               audio_playSound(SFX_EXPLOSION, alien->x);
+                               audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
                                player.hit = 5;
-                               audio_playSound(SFX_HIT, player.x);
+                               audio_playSound(SFX_HIT, player.x, player.y);
                        }
 
                        if (alien->classDef == CD_ASTEROID2)
                        {
-                               if (!engine.cheatShield)
+                               if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0))
                                        player.shield -= alien->shield;
                                alien->shield = 0;
-                               audio_playSound(SFX_EXPLOSION, alien->x);
+                               audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
                                player.hit = 5;
-                               audio_playSound(SFX_HIT, player.x);
+                               audio_playSound(SFX_HIT, player.x, player.y);
                        }
 
                        if (alien->classDef == CD_BARRIER)
                        {
-                               if (!engine.cheatShield)
+                               if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0))
                                        player.shield--;
                                player.hit = 5;
-                               audio_playSound(SFX_HIT, player.x);
+                               audio_playSound(SFX_HIT, player.x, player.y);
                        }
                }
        }
@@ -1541,7 +1690,7 @@ Fill in later...
 */
 void alien_destroy(object *alien, object *attacker)
 {
-       audio_playSound(SFX_EXPLOSION, alien->x);
+       audio_playSound(SFX_EXPLOSION, alien->x, alien->y);
 
        if (alien->flags & FL_FRIEND)
        {
@@ -1593,7 +1742,7 @@ void alien_destroy(object *alien, object *attacker)
 
        if (rand() % 100 <= alien->collectChance)
        {
-               unsigned char value;
+               int value;
 
                if ((rand() % 10) == 0)
                        alien->collectValue *= 2;
@@ -1615,11 +1764,11 @@ void alien_destroy(object *alien, object *attacker)
        }
 
        if ((alien->classDef == CD_KRASS) && (attacker == &player))
-               setRadioMessage(FACE_CHRIS, "²¶¤Ï¥¯¥ê¥¹¤À¡¢¥¸¥¸¥¤¡£", 1);
+               setRadioMessage(FS_CHRIS, "²¶¤Ï¥¯¥ê¥¹¤À¡¢¥¸¥¸¥¤¡£", 1);
 
        if (alien->classDef == CD_KLINE)
        {
-               setRadioMessage(FACE_KLINE, "¸÷±É¤Ë»×¤¦¤¾¡Äµ®ÍͤÈÀ廊¤¿¤³¤È¤ò¡Ä", 1);
+               setRadioMessage(FS_KLINE, "¸÷±É¤Ë»×¤¦¤¾¡Äµ®ÍͤÈÀ廊¤¿¤³¤È¤ò¡Ä", 1);
                alien->dx = alien->dy = 0;
                alien->shield = -150;
        }
@@ -1627,6 +1776,8 @@ void alien_destroy(object *alien, object *attacker)
 
 void alien_hurt(object *alien, object *attacker, int damage, bool ion)
 {
+       double run_chance;
+
        if (ion)
                alien->systemPower -= damage;
        else
@@ -1647,7 +1798,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
                        {
                                alien->flags |= FL_LEAVESECTOR;
                                alien->flags &= ~FL_CIRCLES;
-                               setRadioMessage(FACE_KLINE, "¤ªÁ°¤ò¸«¤¯¤Ó¤Ã¤Æ¤¤¤¿¤è¤¦¤À¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¤Þ¤¿²ñ¤¦¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦!", 1);
+                               setRadioMessage(FS_KLINE, "¤ªÁ°¤ò¸«¤¯¤Ó¤Ã¤Æ¤¤¤¿¤è¤¦¤À¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¤Þ¤¿²ñ¤¦¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦!", 1);
                        }
                }
                else if (game.area == MISN_EARTH)
@@ -1657,7 +1808,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
                        {
                                alien->flags |= FL_LEAVESECTOR;
                                alien->flags &= ~FL_CIRCLES;
-                               setRadioMessage(FACE_SID, "¥¯¥ê¥¹¡¢¥±¥¹¥é¥ó¤¬Æ¨¤²¤ë¤¾!", 1);
+                               setRadioMessage(FS_SID, "¥¯¥ê¥¹¡¢¥±¥¹¥é¥ó¤¬Æ¨¤²¤ë¤¾!", 1);
                        }
                }
                else if (game.area == MISN_VENUS)
@@ -1683,12 +1834,14 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
                }
        }
 
-       if ((alien->flags & FL_RUNSAWAY) && ((rand() % 50) == 0))
+       run_chance = (game.difficulty == DIFFICULTY_ORIGINAL) ? 0.02 : damage / 50.;
+
+       if ((alien->flags & FL_RUNSAWAY) && CHANCE(run_chance))
        {
                alien->flags |= FL_LEAVESECTOR;
        }
 
-       audio_playSound(SFX_HIT, alien->x);
+       audio_playSound(SFX_HIT, alien->x, alien->y);
        if (alien->AIType == AI_EVASIVE)
                alien->thinktime = 0;
        
index 2711afa..6039b1e 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index 8bfcf68..cfc4d15 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -42,13 +42,18 @@ void audio_loadSounds()
        sound[SFX_PLASMA3] = Mix_LoadWAV("sound/plasma3.ogg");
 }
 
-void audio_playSound(int sid, float x)
+void audio_playSound(int sid, float x, float y)
 {
-       if ((!engine.useSound) || (!engine.useAudio))
-               return;
-
        int channel = -1;
        static int freechannel = 4;
+       static int channelVolume[4] = {0, 0, 0, 0};
+       int angle = atanf((x - (screen->w / 2)) / (screen->w / 2)) * 180 / M_PI;
+       int attenuation = fabsf(x - (screen->w / 2)) / (screen->w / 20);
+       float distance = sqrtf(powf(fabsf(x - (screen->w / 2)), 2) + powf(fabsf(y - (screen->h / 2)), 2));
+       int volume = MIX_MAX_VOLUME - (MIX_MAX_VOLUME * distance / (3 * screen->w));
+
+       if ((!engine.useSound) || (!engine.useAudio) || (volume <= 0))
+               return;
 
        switch(sid)
        {
@@ -80,15 +85,22 @@ void audio_playSound(int sid, float x)
                        break;
        }
 
-       if(channel == -1) {
+       if (channel == -1)
+       {
                channel = freechannel++;
-               if(freechannel >= 8)
+               if (freechannel >= 8)
                        freechannel = 4;
        }
+       else
+       {
+               if (Mix_Playing(channel) && (volume <= MIX_MAX_VOLUME / 4) &&
+                               (channelVolume[channel] >= MIX_MAX_VOLUME * 3 / 4))
+                       return;
+               else
+                       channelVolume[channel] = volume;
+       }
 
-       int angle = atanf((x - (screen->w / 2)) / (screen->w / 2)) * 180 / M_PI;
-       int attenuation = fabsf(x - (screen->w / 2)) / 40;
-
+       angle %= 360;
        if (angle < 0)
                angle += 360;
 
@@ -96,6 +108,7 @@ void audio_playSound(int sid, float x)
                attenuation = 255;
 
        Mix_SetPosition(channel, angle, attenuation);
+       Mix_Volume(channel, volume);
        Mix_PlayChannel(channel, sound[sid], 0);
 }
 
index 8351253..68402ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -21,7 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define AUDIO_H
 
 void audio_loadSounds();
-void audio_playSound(int sid, float x);
+void audio_playSound(int sid, float x, float y);
 void audio_haltMusic();
 void audio_pauseMusic();
 void audio_resumeMusic();
index e660fb2..6faeb37 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -22,7 +22,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 void bullet_add(object *theWeapon, object *attacker, int y, int dy)
 {
        object *bullet;
-       signed char imageIndex;
+       int imageIndex;
        int tempX, tempY, steps;
 
        bullet = new object;
@@ -131,7 +131,7 @@ void bullet_add(object *theWeapon, object *attacker, int y, int dy)
        {
                bullet->dx = RANDRANGE(-20, 20);
                bullet->dy = RANDRANGE(-20, 20);
-               bullet->image[0] = shape[4];
+               bullet->image[0] = gfx_sprites[SP_SMALL_EXPLOSION];
        }
 
        engine.bulletTail->next = bullet;
@@ -181,3 +181,24 @@ object *bullet_getTarget(object *bullet)
 
        return &aliens[i];
 }
+
+bool bullet_collision(object *bullet, object *ship)
+{
+       float x0 = bullet->x;
+       float y0 = bullet->y;
+       float w0 = bullet->image[0]->w;
+       float h0 = bullet->image[0]->h;
+
+       float x2 = ship->x;
+       float y2 = ship->y;
+       float w1 = ship->image[0]->w;
+       float h1 = ship->image[0]->h;
+
+       float x1 = x0 + w0;
+       float y1 = y0 + h0;
+
+       float x3 = x2 + w1;
+       float y3 = y2 + h1;
+
+       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
+}
index 9489383..dac88cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -22,5 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 void bullet_add(object *theWeapon, object *attacker, int y, int dy);
 object *bullet_getTarget(object *bullet);
+bool bullet_collision(object *bullet, object *ship);
 
 #endif
index fbf8e96..5675473 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -58,9 +58,9 @@ object *cargo_add(object *owner, int cargoType)
        cargo[index].dx = 0;
        cargo[index].dy = 0;
        cargo[index].collectType = cargoType;
-       cargo[index].image[0] = shape[32];
+       cargo[index].image[0] = gfx_sprites[SP_CARGO];
        if (cargoType == P_PHOEBE)
-               cargo[index].image[0] = shipShape[20];
+               cargo[index].image[0] = gfx_shipSprites[SS_FRIEND];
 
        return &cargo[index];
 }
@@ -76,7 +76,7 @@ void cargo_becomeCollectable(int i)
                aliens[ALIEN_PHOEBE].active = true;
                aliens[ALIEN_PHOEBE].x = cargo[i].x;
                aliens[ALIEN_PHOEBE].y = cargo[i].y;
-               setRadioMessage(FACE_PHOEBE, "¤¢¤ê¤¬¤È¤¦!! ¸«¤Ê¤µ¤¤¡¢WEAPCO! ²òÊü¤µ¤ì¤¿¥Õ¥§¡¼¥Ù¤ÎÅܤê¤ò!!!", 1);
+               setRadioMessage(FS_PHOEBE, "¤¢¤ê¤¬¤È¤¦!! ¸«¤Ê¤µ¤¤¡¢WEAPCO! ²òÊü¤µ¤ì¤¿¥Õ¥§¡¼¥Ù¤ÎÅܤê¤ò!!!", 1);
        }
 
        cargo[i].active = false;
index 5d1c3bf..d5ff5ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index cf0c155..83960f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -153,52 +153,52 @@ void collectable_add(float x, float y, int type, int value, int life)
        switch(type)
        {
                case P_CASH:
-                       collectable->image = shape[24];
+                       collectable->image = gfx_sprites[SP_PICKUP_MONEY];
                        break;
 
                case P_ROCKET:
-                       collectable->image = shape[49];
+                       collectable->image = gfx_sprites[SP_PICKUP_ROCKETS];
                        break;
 
                case P_PLASMA_AMMO:
-                       collectable->image = shape[25];
+                       collectable->image = gfx_sprites[SP_PICKUP_PLASMA];
                        break;
 
                case P_SHIELD:
-                       collectable->image = shape[26];
+                       collectable->image = gfx_sprites[SP_PICKUP_SHIELD];
                        break;
 
                case P_PLASMA_SHOT:
-                       collectable->image = shape[27];
+                       collectable->image = gfx_sprites[SP_PICKUP_PLASMA_OUTPUT];
                        break;
 
                case P_PLASMA_RATE:
-                       collectable->image = shape[28];
+                       collectable->image = gfx_sprites[SP_PICKUP_PLASMA_RATE];
                        break;
 
                case P_PLASMA_DAMAGE:
-                       collectable->image = shape[29];
+                       collectable->image = gfx_sprites[SP_PICKUP_PLASMA_POWER];
                        break;
 
                case P_CARGO:
-                       collectable->image = shape[32];
+                       collectable->image = gfx_sprites[SP_CARGO];
                        break;
 
                case P_SUPER:
-                       collectable->image = shape[50];
+                       collectable->image = gfx_sprites[SP_SUPERCHARGE];
                        break;
 
                case P_MINE:
-                       collectable->image = shape[31];
+                       collectable->image = gfx_sprites[SP_MINE];
                        break;
 
                case P_SLAVES:
                case P_ESCAPEPOD:
-                       collectable->image = shape[45];
+                       collectable->image = gfx_sprites[SP_ESCAPE_POD];
                        break;
 
                case P_ORE:
-                       collectable->image = shape[46 + rand() % 3];
+                       collectable->image = gfx_sprites[RANDRANGE(SP_ORE, SP_ORE_L)];
                        break;
        }
 
@@ -206,15 +206,34 @@ void collectable_add(float x, float y, int type, int value, int life)
        engine.collectableTail = collectable;
 }
 
+bool collectable_collision(collectables *collectable, object *ship)
+{
+       float x0 = collectable->x;
+       float y0 = collectable->y;
+       float w0 = collectable->image->w;
+       float h0 = collectable->image->h;
+
+       float x2 = ship->x;
+       float y2 = ship->y;
+       float w1 = ship->image[0]->w;
+       float h1 = ship->image[0]->h;
+
+       float x1 = x0 + w0;
+       float y1 = y0 + h0;
+
+       float x3 = x2 + w1;
+       float y3 = y2 + h1;
+
+       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
+}
+
 void collectable_explode(collectables *collectable)
 {
-       if ((collectable->x >= 0) && (collectable->x <= screen->w) &&
-                       (collectable->y >= 0) && (collectable->y <= screen->h))
-               audio_playSound(SFX_EXPLOSION, collectable->x);
+       audio_playSound(SFX_EXPLOSION, collectable->x, collectable->y);
 
        for (int i = 0 ; i < 10 ; i++)
-               explosion_add(collectable->x + rand() % 25 - rand() % 25,
-                       collectable->y + rand() % 25 - rand() % 25, E_BIG_EXPLOSION);
+               explosion_add(RANDRANGE(collectable->x - 25, collectable->x + 25),
+                       RANDRANGE(collectable->y - 25, collectable->y + 25), SP_BIG_EXPLOSION);
 
        player_checkShockDamage(collectable->x, collectable->y);
 }
index 343ae1a..1579ffd 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define COLLECTABLE_H
 
 void collectable_add(float x, float y, int type, int value, int life);
+bool collectable_collision(collectables *collectable, object *ship);
 void collectable_explode(collectables *collectable);
 
 #endif
diff --git a/src/colors.cpp b/src/colors.cpp
new file mode 100644 (file)
index 0000000..137e1fe
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <SDL.h>
+
+#include "Starfighter.h"
+
+Uint32 red;
+Uint32 darkRed;
+Uint32 yellow;
+Uint32 darkYellow;
+Uint32 green;
+Uint32 darkGreen;
+Uint32 blue;
+Uint32 darkBlue;
+Uint32 darkerBlue;
+Uint32 black;
+Uint32 white;
+Uint32 lightGrey;
+Uint32 darkGrey;
+
+/*
+Finds the location of the requested color within the palette and returns
+it's number. This colors are used for drawing rectangles, circle, etc in
+the correct colors.
+*/
+void colors_init()
+{
+       red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00);
+       darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00);
+
+       yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
+       darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00);
+
+       green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00);
+       darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00);
+
+       blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff);
+       darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x99);
+       darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44);
+
+       black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
+       white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
+       lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc);
+       darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99);
+}
diff --git a/src/colors.h b/src/colors.h
new file mode 100644 (file)
index 0000000..3cbf76d
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef COLORS_H
+#define COLORS_H
+
+extern Uint32 red;
+extern Uint32 darkRed;
+extern Uint32 yellow;
+extern Uint32 darkYellow;
+extern Uint32 green;
+extern Uint32 darkGreen;
+extern Uint32 blue;
+extern Uint32 darkBlue;
+extern Uint32 darkerBlue;
+extern Uint32 black;
+extern Uint32 white;
+extern Uint32 lightGrey;
+extern Uint32 darkGrey;
+
+void colors_init();
+
+#endif
diff --git a/src/cutscene.cpp b/src/cutscene.cpp
new file mode 100644 (file)
index 0000000..68c087f
--- /dev/null
@@ -0,0 +1,454 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "Starfighter.h"
+
+typedef struct Message_ {
+
+       int face;
+       char message[255];
+
+} Message;
+
+
+static Message messages[MAX_EVENTS];
+
+void cutscene_init(int scene)
+{
+       screen_clear(black);
+       renderer_update();
+       screen_clear(black);
+
+       engine.keyState[KEY_FIRE] = 0; 
+       engine.keyState[KEY_ALTFIRE] = 0;
+
+       engine.ssx = -0.5;
+       engine.ssy = 0;
+       engine.smx = 0;
+       engine.smy = 0;
+
+       screen_flushBuffer();
+       gfx_free();
+       resetLists();
+       loadGameGraphics();
+
+       for (int i = 0 ; i < ALIEN_MAX ; i++)
+       {
+               // 0 is the dualfighter, but there doesn't seem to be any
+               // particular reason for choosing this alien def.
+               aliens[i] = alien_defs[0];
+               aliens[i].face = 0;
+               aliens[i].active = false;
+       }
+
+       for (int i = 0 ; i < MAX_EVENTS ; i++)
+       {
+               strcpy(messages[i].message, "");
+               messages[i].face = -1;
+       }
+
+       switch (scene)
+       {
+               case 0:
+                       loadBackground("gfx/spirit.jpg");
+                       engine.ssx = -3;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w * 3 / 5;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 3.1;
+                       aliens[0].active = true;
+
+                       for (int i = 1 ; i < 7 ; i++)
+                       {
+                               aliens[i].image[0] = gfx_shipSprites[SS_DUALFIGHTER];
+                               aliens[i].x = RANDRANGE(0, screen->w / 8);
+                               aliens[i].y = RANDRANGE(50, screen->h - 50);
+                               aliens[i].dx = 3;
+                               aliens[i].active = true;
+                       }
+
+                       messages[0].face = -1;
+                       strcpy(messages[0].message, "¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É¤Ï¿·¤¿¤Ë³ÍÆÀ¤·¤¿¡Ø¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¡Ù¤ÇƨÁö¤¹¤ëÅÓÃæ¡¢¤Ä¤¤¤ËWEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤ËÊ᪤µ¤ì¤¿¡Ä");
+
+                       messages[1].face = FS_CHRIS;
+                       strcpy(messages[1].message, "¤Þ¤ÀÄɤäÆÍè¤ë¤Î¤«!?");
+
+                       messages[2].face = FS_CHRIS;
+                       strcpy(messages[2].message, "¤Þ¤À¤³¤Î´Ï¤ÎÁà½Ä¤Ë´·¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢¥Ñ¥È¥í¡¼¥ë´Ï¤ò½¸¹çÃÏÅÀ¤Þ¤ÇÏ¢¤ì¤Æ¹Ô¤¯¤ï¤±¤Ë¤Ï¤¤¤«¤Ê¤¤¡Ä");
+
+                       messages[3].face = FS_CHRIS;
+                       strcpy(messages[3].message, "¡Ä¤¤¤º¤ìÀ臘¤³¤È¤Ë¤Ê¤ë¤Î¤À¡£¤Ê¤é¤Ð¤³¤Î´Ï¤ÎÀ­Ç½¤ò»î¤·¤Æ¤ä¤ë!");
+
+                       break;
+
+               case 1:
+                       loadBackground("gfx/sol.jpg");
+                       engine.ssx = -0.5;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_KLINE];
+                       aliens[0].x = screen->w / 2;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 0.5;
+                       aliens[0].active = true;
+
+                       for (int i = 1 ; i < 15 ; i++)
+                       {
+                               aliens[i].image[0] = gfx_shipSprites[SS_DUALFIGHTER];
+                               aliens[i].x = RANDRANGE(0, screen->w);
+                               aliens[i].y = RANDRANGE(50, screen->h - 50);
+                               aliens[i].dx = RANDRANGE(1, 3);
+                               aliens[i].active = true;
+                       }
+
+                       messages[0].face = -1;
+                       strcpy(messages[0].message, "¿ô»þ´Ö¸å¡¢¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É¤Î³èÌö¤ÏÂÀÍ۷ϤޤÇÅÁ¤ï¤Ã¤¿¡£WEAPCO¤Î´ÏÂâ»ÊÎá´±¤ÏÈà¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¹Í¤¨¤Æ¤¤¤¿¡£");
+
+                       messages[1].face = FS_KLINE;
+                       strcpy(messages[1].message, "Ä벦¤ÏÉÔµ¡·ù¤À¤í¤¦¤Ê¡£º£¤ä¥¹¥Ô¥ê¥Ã¥È·Ï¤Ï¤¢¤ÎÈ¿µÕ¼Ô¤Î¥Ñ¥¤¥í¥Ã¥È¤Ë¤è¤Ã¤Æ²òÊü¤µ¤ì¤¿¡£");
+
+                       messages[2].face = FS_KLINE;
+                       strcpy(messages[2].message, "Êó¹ð¤Ë¤è¤ì¤Ð¡¢²æ¡¹¤ÎºÇ¤â¶¯ÎϤʥեꥲ¡¼¥È¤ÎÆâ¤Î°ìÀɤòÂǤÁ¤Î¤á¤¹¤Î¤Ë3ʬ¤È³Ý¤«¤é¤Ê¤«¤Ã¤¿!");
+
+                       messages[3].face = FS_KLINE;
+                       strcpy(messages[3].message, "¤½¤ó¤ÊºÍǽ¤ò»ý¤Ä¼Ô¤Ï¤á¤Ã¤¿¤Ë¤¤¤Ê¤¤¡£Åۤϲ桹¤Î¿·¤·¤¤AI¥È¥ì¡¼¥Ë¥ó¥°¥×¥í¥°¥é¥à¤Î¸õÊä¤È¤·¤Æ¤Ï´°àú¤À!");
+
+                       messages[4].face = FS_KLINE;
+                       strcpy(messages[4].message, "ÅÛ¤ò»¦¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤¬»ÄÇ°¤À¡Ä");
+
+                       break;
+
+               case 2:
+                       loadBackground("gfx/spirit.jpg");
+                       engine.ssx = -1.4;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w / 4;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 1.5;
+                       aliens[0].active = true;
+
+                       aliens[1].image[0] = gfx_shipSprites[SS_SID];
+                       aliens[1].x = screen->w / 4 - 50;
+                       aliens[1].y = screen->h / 2 - 40;
+                       aliens[1].dx = 1.5;
+                       aliens[1].active = true;
+
+                       messages[0].face = FS_SID;
+                       strcpy(messages[0].message, "¤â¤¦¤¹¤°¥¨¥ä¥Ê¥ó¥¹·Ï¤Ø¤Î¥ï¡¼¥×¤¬»Ï¤Þ¤ë¡£");
+
+                       messages[1].face = FS_CHRIS;
+                       strcpy(messages[1].message, "¤½¤ÎÀ±·Ï¤Ë¤Ï¤¿¤¯¤µ¤ó¤ÎWEAPCO¤ÎÅÛÎ줬¤¤¤ë¤Î¤À¤í¤¦?");
+
+                       messages[2].face = FS_SID;
+                       strcpy(messages[2].message, "¤½¤ÎÄ̤ê¤À¡£¤½¤³¤Ï¤³¤Î¶ä²Ï¤ÇºÇ¤â´í¸±¤Ê¾ì½ê¤Î1¤Ä¤À¡£");
+
+                       messages[3].face = FS_CHRIS;
+                       strcpy(messages[3].message, "¤½¤³¤Ë¹Ô¤±¤ÐÍ­Íø¤Ë¤Ê¤ë¤È?");
+
+                       messages[4].face = FS_SID;
+                       strcpy(messages[4].message, "¤½¤¦¤À¡£»ä¤Ë·×²è¤¬¤¢¤ë¡£");
+
+                       break;
+
+               case 3:
+                       loadBackground("gfx/eyananth.jpg");
+                       engine.ssx = -0.5;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w * 3 / 8;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 0.5;
+                       aliens[0].active = true;
+
+                       aliens[1].image[0] = gfx_shipSprites[SS_SID];
+                       aliens[1].x = screen->w * 3 / 8 - 50;
+                       aliens[1].y = screen->h / 2 - 40;
+                       aliens[1].dx = 0.5;
+                       aliens[1].active = true;
+
+                       aliens[2].image[0] = gfx_shipSprites[SS_FRIEND];
+                       aliens[2].x = screen->w * 3 / 8 - 50;
+                       aliens[2].y = screen->h / 2 + 40;
+                       aliens[2].dx = 0.5;
+                       aliens[2].active = true;
+
+                       messages[0].face = FS_PHOEBE;
+                       strcpy(messages[0].message, "¤¤¤¤¥Ø¥Ã¥É¥®¥¢¤Í! ¤â¤·¤«¤·¤ÆƱ¤¸Å¹¤ÇÇã¤Ã¤¿¤ó¤¸¤ã¤Ê¤¤?");
+
+                       messages[1].face = FS_CHRIS;
+                       strcpy(messages[1].message, "¤â¤Ã¤È½ÅÍפʤ³¤È¤¬¤¢¤ë¡£¤¢¤½¤³¤Ç²¿¤ò¤·¤Æ¤¿¤ó¤À? ²¶¤¬¶á¤¯¤Ë¤¤¤Æ¤è¤«¤Ã¤¿¤è!");
+
+                       messages[2].face = FS_PHOEBE;
+                       strcpy(messages[2].message, "»Ð¤µ¤ó¤òõ¤·¤Æ¤¿¡£1½µ´ÖÁ°¤Ë¤¤¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¤Î¡£");
+
+                       messages[3].face = FS_PHOEBE;
+                       strcpy(messages[3].message, "ÂԤäÆ! ¤¢¤Ê¤¿¤¿¤Á¥¹¥Ô¥ê¥Ã¥È·Ï¤«¤éÍ褿ȿÍ𷳤Ǥ·¤ç¤¦! ¤¹¤´¤¤¤ï! »ä¤â²Ã¤ï¤Ã¤Æ¤¤¤¤?");
+
+                       messages[4].face = FS_CHRIS;
+                       strcpy(messages[4].message, "¿·¤¿¤ÊÀïÎϤ«? ²¶¤Ïº¤¤é¤Ê¤¤¤Ê! ¤É¤¦¤À¡¢¥·¥É?");
+
+                       messages[5].face = FS_SID;
+                       strcpy(messages[5].message, "¤¤¤¤¤À¤í¤¦¡£¤½¤ÎͶƳ¥ß¥µ¥¤¥ë¤Ë¤â¶½Ì£¤¬¤¢¤ë¡£¤½¤ì¤Ï½õ¤±¤Ë¤Ê¤ê¤½¤¦¤À¡£");
+
+                       messages[6].face = FS_CHRIS;
+                       strcpy(messages[6].message, "¤½¤¦¤¤¤¦¤ï¤±¤À¡£¤è¤¦¤³¤½!");
+
+                       break;
+
+               case 4:
+                       loadBackground("gfx/eyananth.jpg");
+                       engine.ssx = -1.4;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w / 4;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 1.5;
+                       aliens[0].active = true;
+
+                       aliens[1].image[0] = gfx_shipSprites[SS_SID];
+                       aliens[1].x = screen->w / 4 - 50;
+                       aliens[1].y = screen->h / 2 - 40;
+                       aliens[1].dx = 1.5;
+                       aliens[1].active = true;
+
+                       aliens[2].image[0] = gfx_shipSprites[SS_FRIEND];
+                       aliens[2].x = screen->w / 4 - 50;
+                       aliens[2].y = screen->h / 2 + 40;
+                       aliens[2].dx = 1.5;
+                       aliens[2].active = true;
+
+                       messages[0].face = FS_SID;
+                       strcpy(messages[0].message, "²¿¤¬¤¢¤Ã¤¿¤ó¤À¡¢¥¯¥ê¥¹¡£±ÇÁü¤¬ÅÓÀ䤨¤Æ¤¤¤¿¡£");
+
+                       messages[1].face = FS_CHRIS;
+                       strcpy(messages[1].message, "WEAPCO¤ÎºÎ·¡Á¥¤òÇ˲õ¤·¤¿¤¬¡¢¤½¤Îľ¸å¤Ë¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó¤È̾¾è¤ëÃˤ˲ñ¤Ã¤¿¡£");
+
+                       messages[2].face = FS_SID;
+                       strcpy(messages[2].message, "ʹ¤¤¤¿¤³¤È¤¬¤¢¤ë¡£WEAPCO¤Î´ÏÂâ»ÊÎá´±¤Ç¤¢¤ê¡¢ºÇ¤âÍ¥½¨¤Ê¥Ñ¥¤¥í¥Ã¥È¤Î°ì¿Í¤À¡£");
+
+                       messages[3].face = FS_CHRIS;
+                       strcpy(messages[3].message, "Åۤϲ¶¤òÃϹö¤ÎÍͤÊÀ襤¤Ë°ú¤­¤º¤ê¹þ¤ó¤À! ¤À¤¬¡¢¤¹¤°¤Ëµî¤Ã¤Æ¹Ô¤Ã¤¿¡£");
+
+                       messages[4].face = FS_CHRIS;
+                       strcpy(messages[4].message, "¤½¤ì¤è¤ê¥·¥É¡¢¥â¥ë¥É¡¼¥ë·Ï¤Î¾ðÊó¤Ï¤¢¤ë¤«?");
+
+                       messages[5].face = FS_SID;
+                       strcpy(messages[5].message, "µß½Ð¤·¤¿²Ê³Ø¼Ô¤Ë¤è¤ë¤È¡¢WEAPCO¤Ï¤½¤³¤Ç¿··¿ÀïÆ®µ¡¤Î»î¸³¤ò¤·¤Æ¤¤¤ë¤½¤¦¤À¡£");
+
+                       messages[6].face = FS_CHRIS;
+                       strcpy(messages[6].message, "¤½¤¤¤Ä¤ò¤Ö¤Ã²õ¤·¤Æ¡¢³«È¯¤ò»ß¤á¤Í¤Ð¤é¤Ê¤ó¤Ê¡£");
+
+                       messages[7].face = FS_SID;
+                       strcpy(messages[7].message, "¤½¤ÎÄ̤ê¤À¡£");
+
+                       messages[8].face = FS_PHOEBE;
+                       strcpy(messages[8].message, "¤½¤³¤Ë»Ð¤µ¤ó¤¬¤¤¤ë¤Î¤«¤·¤é¡Ä¡£");
+
+                       break;
+
+               case 5:
+                       loadBackground("gfx/mordor.jpg");
+                       engine.ssx = -0.5;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w * 3 / 8;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 0.5;
+                       aliens[0].active = true;
+
+                       aliens[1].image[0] = gfx_shipSprites[SS_SID];
+                       aliens[1].x = screen->w * 3 / 8 - 50;
+                       aliens[1].y = screen->h / 2 - 40;
+                       aliens[1].dx = 0.5;
+                       aliens[1].active = true;
+
+                       aliens[2].image[0] = gfx_shipSprites[SS_FRIEND];
+                       aliens[2].x = screen->w * 3 / 8 - 50;
+                       aliens[2].y = screen->h / 2 + 40;
+                       aliens[2].dx = 0.5;
+                       aliens[2].active = true;
+
+                       messages[0].face = FS_PHOEBE;
+                       strcpy(messages[0].message, "»Ð¤µ¤ó¤Ï¤À¤¤¤¸¤ç¤¦¤Ö?");
+
+                       messages[1].face = FS_SID;
+                       strcpy(messages[1].message, "²¿¤«¥¤¥ó¥×¥é¥ó¥È¤Î¤è¤¦¤Êʪ¤¬¤¢¤Ã¤¿¤¬¼è¤ê½ü¤±¤¿¡£¤Þ¤À¤·¤Ð¤é¤¯¤Î´Ö¤ÏƬÄˤ¬¤¹¤ë¤À¤í¤¦¡£");
+
+                       messages[2].face = FS_CHRIS;
+                       strcpy(messages[2].message, "²¿¤«½ÅÍפʤ³¤È¤Ïʹ¤±¤½¤¦¤«?");
+
+                       messages[3].face = FS_SID;
+                       strcpy(messages[3].message, "µ­²±¤¬Ìá¤ë¤Þ¤Ç¾¯¤·ÂÔ¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥¤¥ó¥×¥é¥ó¥È¤¬¤¢¤Ã¤¿¤È¤­¤Î¤³¤È¤Ï»×¤¤½Ð¤»¤Ê¤¤¤À¤í¤¦¡£");
+
+                       messages[4].face = FS_SID;
+                       strcpy(messages[4].message, "¤½¤ì¤Ç¤â´Ï¤ÎÁà½Ä¤Ï¤Ç¤­¤½¤¦¤À¡£");
+
+                       break;
+
+               case 6:
+                       loadBackground("gfx/mordor.jpg");
+                       engine.ssx = -1.4;
+                       engine.ssy = 0;
+
+                       aliens[0].image[0] = gfx_shipSprites[SS_FIREFLY];
+                       aliens[0].x = screen->w / 4;
+                       aliens[0].y = screen->h / 2;
+                       aliens[0].dx = 1.5;
+                       aliens[0].active = true;
+
+                       aliens[1].image[0] = gfx_shipSprites[SS_SID];
+                       aliens[1].x = screen->w / 4 - 50;
+                       aliens[1].y = screen->h / 2 - 40;
+                       aliens[1].dx = 1.5;
+                       aliens[1].active = true;
+
+                       aliens[2].image[0] = gfx_shipSprites[SS_FRIEND];
+                       aliens[2].x = screen->w / 4 - 50;
+                       aliens[2].y = screen->h / 2 + 40;
+                       aliens[2].dx = 1.5;
+                       aliens[2].active = true;
+
+                       aliens[3].image[0] = gfx_shipSprites[SS_FRIEND];
+                       aliens[3].x = screen->w / 4 - 90;
+                       aliens[3].y = screen->h / 2;
+                       aliens[3].dx = 1.5;
+                       aliens[3].active = true;
+
+                       messages[0].face = FS_CHRIS;
+                       strcpy(messages[0].message, "¤¹¤Þ¤Ê¤¤¡£Àڤ껥¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
+
+                       messages[1].face = FS_SID;
+                       strcpy(messages[1].message, "µ¤¤Ë¤¹¤ë¤Ê¡£»ä¤Î˾¤ó¤ÀÊýË¡¤Ç¤Ï¤Ê¤«¤Ã¤¿¤¬¡¢¤³¤ì¤ÇWEAPCO¤òÅݤ·¤ä¤¹¤¯¤Ê¤Ã¤¿¡£");
+
+                       messages[2].face = FS_SID;
+                       strcpy(messages[2].message, "ÂÀÍ۷ϤǤÎÀ襤¤Ï¡¢º¤Æñ¤Ê¤â¤Î¤Ë¤Ê¤ë¤À¤í¤¦¡£³°ÏÇÀ±¤Ë¶¯ÎϤÊËɸæ¤òÉߤ¤¤Æ¤¤¤ë¤Èʹ¤¤¤¿¡£");
+
+                       messages[3].face = FS_PHOEBE;
+                       strcpy(messages[3].message, "¤Ê¤é¤Ð¡¢¤½¤³¤«¤é»Ï¤á¤Ê¤¤¤È¤Í¡£");
+
+                       messages[4].face = FS_SID;
+                       strcpy(messages[4].message, "¤½¤³¤Ë¤¤¤ë·³ÃĤϺ£¤Þ¤Ç¤È¤ÏÁ´¤¯°Û¤Ê¤ë¤â¤Î¤À¡£³§¡¢µ¤¤ò¤Ä¤±¤í¡£");
+
+                       break;
+       }
+
+       /*
+               Because we can fiddle with the images, we need to set the engines to 
+               the correct places on the craft. Otherwise it will look wrong
+       */
+       for (int i = 0 ; i < 15 ; i++)
+       {
+               aliens[i].engineX = aliens[i].image[0]->w;
+               aliens[i].engineY = (aliens[i].image[0]->h / 2);
+       }
+
+       bool showMessage = false;
+       int currentMessage = -1;
+       int timer = 60 * 4;
+
+       screen_drawBackground();
+
+       SDL_Surface *face;
+       
+       flushInput();
+
+       while (true)
+       {
+               renderer_update();
+               screen_unBuffer();
+               getPlayerInput();
+               game_doStars();
+               game_doExplosions();
+
+               for (int i = 0 ; i < 15 ; i++)
+               {
+                       if (aliens[i].active)
+                       {
+                               explosion_addEngine(&aliens[i]);
+                               if (scene == 0 && i > 0 && (timer % 15) == i) {
+                                       aliens[i].dx += (drand48() - 0.5) * 0.1;
+                                       aliens[i].dy += (drand48() - 0.5) * 0.1;
+                                       if (aliens[i].x > 500 - timer)
+                                               aliens[i].dx -= 0.2;
+                                       if (aliens[i].x < 0)
+                                               aliens[i].dx += 0.2;
+                               }
+                               aliens[i].x += aliens[i].dx;
+                               aliens[i].y += aliens[i].dy;
+                               aliens[i].x += engine.ssx + engine.smx;
+                               screen_blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
+                               if (aliens[i].x > (screen->w + 50))
+                               {
+                                       aliens[i].x = -50;
+                                       aliens[i].y = rand() % (screen->h - 40);
+                               }
+                               if (aliens[i].y < -50)
+                                       aliens[i].y = (screen->h + 50);
+                               if (aliens[i].y > (screen->h + 50))
+                                       aliens[i].y = -50;
+                       }
+               }
+
+               timer--;
+               if (timer == 0)
+               {
+                       showMessage = !showMessage;
+                       timer = 120;
+                       if (showMessage)
+                       {
+                               timer = 60 * 7;
+                               currentMessage++;
+
+                               if (currentMessage == 10)
+                                       break;
+
+                               if (strcmp(messages[currentMessage].message, "") == 0)
+                                       break;
+
+                               face = NULL;
+                               if (messages[currentMessage].face != -1)
+                                       face = gfx_faceSprites[messages[currentMessage].face];
+                               gfx_createMessageBox(face, messages[currentMessage].message, 0);
+                       }
+               }
+
+               if ((showMessage) && (gfx_messageBox != NULL))
+                       screen_blit(gfx_messageBox, (screen->w - gfx_messageBox->w) / 2, screen->h - 100);
+
+               screen_renderString("²¿¤«¥­¡¼¤ò²¡¤¹¤È¥¹¥­¥Ã¥×¤¹¤ë", -1, 580, FONT_WHITE);
+
+               game_delayFrame();
+
+               if ((engine.keyState[KEY_ESCAPE]) || (engine.keyState[KEY_FIRE]) ||
+                               (engine.keyState[KEY_ALTFIRE]))
+                       break;
+       }
+
+       screen_flushBuffer();
+       gfx_free();
+       screen_clear(black);
+       renderer_update();
+}
similarity index 77%
rename from src/init.h
rename to src/cutscene.h
index a58848c..18f807c 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -17,12 +17,9 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef INIT_H
-#define INIT_H
+#ifndef CUTSCENE_H
+#define CUTSCENE_H
 
-extern void initVars();
-extern void showErrorAndExit(int errorId, const char *name);
-extern void initSystem();
-extern void cleanUp();
+void cutscene_init(int scene);
 
 #endif
index b62bf9c..541156e 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -20,6 +20,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef DEFS_H
 #define DEFS_H
 
+#include <stdlib.h>
+
+
+// Macros
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define LIMIT(x, a, b) x = ((x) < (b) ? ((x) > (a) ? (x) : (a)) : (b))
@@ -29,10 +33,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
        ((x) + (y) < (a) ? ((b) - (a)) : 0) + \
        ((x) + (y) > (b) ? ((a) - (b)) : 0))
-#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (1 + (y) - (x)))) : (x))
+#define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
+#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
 
-// ALL
-#define NONE 0
 
 // Compile-time options
 #ifndef VERSION
@@ -43,10 +46,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define DATADIR "."
 #endif 
 
+#ifndef SCREEN_WIDTH
+#define SCREEN_WIDTH 800
+#endif
+
+#ifndef SCREEN_HEIGHT
+#define SCREEN_HEIGHT 600
+#endif
+
 #ifndef PATH_MAX
-#define PATH_MAX       4096
+#define PATH_MAX 4096
 #endif
 
+#define STARS_NUM 200
+
 // Object Flags
 #define FL_WEAPCO 1
 #define FL_FRIEND 2
@@ -60,7 +73,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define FL_DROPMINES 512
 #define FL_AIMS 1024
 #define FL_DISABLED 2048
-#define FL_CANNOTDIE 4096 // This will only apply to Kline before the final mission
+#define FL_CANNOTDIE 4096 // No longer used
 #define FL_RUNSAWAY 8192
 #define FL_ALWAYSFACE 16384 // Kline doesn't turn his back on you! ;)
 #define FL_CIRCLES 32768L // Kline can circle around
@@ -72,13 +85,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define FL_HASMINIMUMSPEED 2097152L
 #define FL_FIRELASER 4194304L
 
-// Explosions
-#define E_SMALL_EXPLOSION 4
-#define E_BIG_EXPLOSION 8
-#define E_SMOKE 12
-#define E_TINY_EXPLOSION 16
-#define E_ELECTRICAL 20
-
 // Weapon flags
 #define WF_SPREAD 4
 #define WF_SCATTER 8
@@ -91,19 +97,28 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define WF_DISABLE 1024
 #define WF_TIMEDEXPLOSION 2048
 
-#define MAX_WEAPONS 20
-#define MAX_SHAPES 100
-#define MAX_SHIPSHAPES 120
-#define MAX_TEXTSHAPES 150
-#define MAX_FONTSHAPES 6
-#define MAX_SHOPSHAPES 6
 #define MAX_CARGO 20
-
-#define SHIP_HIT_INDEX 60
+#define MAX_INFOLINES 3
+#define MAX_EVENTS 20
+
+
+enum keys {
+       KEY_UP,
+       KEY_DOWN,
+       KEY_LEFT,
+       KEY_RIGHT,
+       KEY_FIRE,
+       KEY_ALTFIRE,
+       KEY_SWITCH,
+       KEY_PAUSE,
+       KEY_ESCAPE,
+       KEY_FULLSCREEN,
+       KEY_DUMMY,
+       KEY_LAST
+};
 
 // AI Types
 enum {
-
        AI_NORMAL = 1,
        AI_DEFENSIVE,
        AI_OFFENSIVE,
@@ -113,23 +128,25 @@ enum {
 
 // These are for Alien *indexes* NOT classdefs!!
 enum {
-
-       ALIEN_BOSS_PART4 = 10,
-       ALIEN_BOSS_PART3 = 11,
-       ALIEN_BOSS_PART2 = 12,
-       ALIEN_BOSS_PART1 = 13,
-       ALIEN_BOSS = 14,
+       ALIEN_NORMAL_LAST = 20,
+       ALIEN_BOSS,
+       ALIEN_BOSS_PART1,
+       ALIEN_BOSS_PART2,
+       ALIEN_BOSS_PART3,
+       ALIEN_BOSS_PART4,
+       ALIEN_BOSS_PART5,
+       ALIEN_BOSS_PART6,
        ALIEN_KLINE,
        ALIEN_PHOEBE,
        ALIEN_URSULA,
        ALIEN_SID,
-       ALIEN_GOODTRANSPORT = 19,
-       ALIEN_MAX = 25
+       ALIEN_FRIEND1,
+       ALIEN_FRIEND2,
+       ALIEN_MAX
 };
 
 // Droppables
 enum {
-
        P_ANYTHING = 1,
        P_WEAPONS,
        P_CASH,
@@ -150,7 +167,6 @@ enum {
 
 // Jobs
 enum {
-
        WT_PLASMA = 1,
        WT_ROCKET,
        WT_ENERGYRAY,
@@ -163,7 +179,6 @@ enum {
 
 // Weapons
 enum {
-
        W_NONE = -1,
        W_PLAYER_WEAPON,
        W_PLAYER_WEAPON2,
@@ -182,13 +197,14 @@ enum {
        W_AIMED_SHOT,
        W_SPREADSHOT,
        W_IONCANNON,
-       W_DIRSHOCKMISSILE
+       W_DIRSHOCKMISSILE,
+       W_MAX
 };
 
 // Mission types
 enum {
-
-       M_DESTROY_ALL_TARGETS = 1,
+       M_NONE,
+       M_DESTROY_ALL_TARGETS,
        M_DESTROY_TARGET_TYPE,
        M_COLLECT,
        M_PROTECT_PICKUP,
@@ -198,7 +214,6 @@ enum {
 };
 
 enum {
-
        OB_JUST_FAILED = -2,
        OB_FAILED,
        OB_INCOMPLETE,
@@ -210,7 +225,6 @@ enum {
 
 // Class Defs - Some of these are just place holders
 enum {
-
        CD_DUALFIGHTER,         // 0
        CD_MISSILEBOAT,
        CD_PROTOFIGHTER,
@@ -259,10 +273,224 @@ enum {
        CD_URSULA
 };
 
-// Text shapes
+// Sprites
+enum {
+       // Intermission
+       SP_CURSOR,
+       SP_START_MISSION,
+       SP_MAP,
+       SP_STATUS,
+       SP_SAVE,
+       SP_SHOP,
+       SP_COMM,
+       SP_OPTIONS,
+       SP_EXIT,
+       SP_PLASMA_MAX_OUTPUT,
+       SP_PLASMA_MAX_POWER,
+       SP_PLASMA_MAX_RATE,
+       SP_PLASMA_AMMO,
+       SP_ROCKET_AMMO,
+       SP_PLASMA_MIN_OUTPUT,
+       SP_PLASMA_MIN_POWER,
+       SP_PLASMA_MIN_RATE,
+       SP_PLASMA_MAX_AMMO,
+       SP_ROCKET_MAX_AMMO,
+       SP_DOUBLE_ROCKETS,
+       SP_MICRO_ROCKETS,
+       SP_LASER,
+       SP_HOMING_MISSILE,
+       SP_CHARGER,
+       SP_DOUBLE_HOMING_MISSILES,
+       SP_MICRO_HOMING_MISSILES,
+       SP_GOTO,
+       SP_BUY,
+       SP_SELL,
+       SP_FIREFLY,
+       SP_SUN,
+       SP_PLANET_GREEN,
+       SP_PLANET_BLUE,
+       SP_PLANET_RED,
+       SP_PLANET_ORANGE,
+
+       // Bullets
+       SP_PLASMA_GREEN,
+       SP_PLASMA_RED,
+       SP_DIR_PLASMA_GREEN,
+       SP_DIR_PLASMA_RED,
+       SP_ION,
+       SP_ROCKET,
+       SP_ROCKET_L,
+
+       // Explosions
+       SP_SMALL_EXPLOSION,
+       SP_SMALL_EXPLOSION_2,
+       SP_SMALL_EXPLOSION_3,
+       SP_SMALL_EXPLOSION_L,
+       SP_BIG_EXPLOSION,
+       SP_BIG_EXPLOSION_2,
+       SP_BIG_EXPLOSION_3,
+       SP_BIG_EXPLOSION_L,
+       SP_SMOKE,
+       SP_SMOKE_2,
+       SP_SMOKE_3,
+       SP_SMOKE_L,
+       SP_TINY_EXPLOSION,
+       SP_TINY_EXPLOSION_2,
+       SP_TINY_EXPLOSION_3,
+       SP_TINY_EXPLOSION_L,
+       SP_ELECTRICAL,
+       SP_ELECTRICAL_2,
+       SP_ELECTRICAL_3,
+       SP_ELECTRICAL_L,
+
+       // Pickups
+       SP_PICKUP_MONEY,
+       SP_PICKUP_PLASMA,
+       SP_PICKUP_ROCKETS,
+       SP_PICKUP_SHIELD,
+       SP_PICKUP_PLASMA_OUTPUT,
+       SP_PICKUP_PLASMA_POWER,
+       SP_PICKUP_PLASMA_RATE,
+       SP_SUPERCHARGE,
+       SP_CARGO,
+       SP_ESCAPE_POD,
+       SP_ORE,
+       SP_ORE_2,
+       SP_ORE_L,
+       SP_CHAIN_LINK,
+       SP_MINE,
+
+       // Targeting system
+       SP_ARROW_NORTH,
+       SP_ARROW_NORTHEAST,
+       SP_ARROW_EAST,
+       SP_ARROW_SOUTHEAST,
+       SP_ARROW_SOUTH,
+       SP_ARROW_SOUTHWEST,
+       SP_ARROW_WEST,
+       SP_ARROW_NORTHWEST,
+       SP_ARROW_FRIEND_NORTH,
+       SP_ARROW_FRIEND_NORTHEAST,
+       SP_ARROW_FRIEND_EAST,
+       SP_ARROW_FRIEND_SOUTHEAST,
+       SP_ARROW_FRIEND_SOUTH,
+       SP_ARROW_FRIEND_SOUTHWEST,
+       SP_ARROW_FRIEND_WEST,
+       SP_ARROW_FRIEND_NORTHWEST,
+       SP_INDICATOR_TARGET,
+       SP_INDICATOR_SID,
+       SP_INDICATOR_PHOEBE,
+       SP_INDICATOR_URSULA,
+       SP_INDICATOR_KLINE,
+
+       SP_MAX
+};
+
+// Face sprites
+enum {
+       FS_CHRIS,
+       FS_SID,
+       FS_KRASS,
+       FS_KLINE,
+       FS_PHOEBE,
+       FS_URSULA,
+       FS_CREW,
+       FS_MAX
+};
+
+// Ship sprites
+enum {
+       SS_FIREFLY,
+       SS_FIREFLY_L,
+       SS_SID,
+       SS_SID_L,
+       SS_FRIEND,
+       SS_FRIEND_L,
+       SS_GOODTRANSPORT,
+       SS_GOODTRANSPORT_L,
+       SS_REBELCARRIER,
+       SS_REBELCARRIER_L,
+       SS_DUALFIGHTER,
+       SS_DUALFIGHTER_L,
+       SS_MISSILEBOAT,
+       SS_MISSILEBOAT_L,
+       SS_PROTOFIGHTER,
+       SS_PROTOFIGHTER_L,
+       SS_AIMFIGHTER,
+       SS_AIMFIGHTER_L,
+       SS_DRONE,
+       SS_DRONE_L,
+       SS_MINER,
+       SS_MINER_L,
+       SS_ESCORT,
+       SS_ESCORT_L,
+       SS_MOBILE_RAY,
+       SS_MOBILE_RAY_L,
+       SS_TRANSPORTSHIP,
+       SS_TRANSPORTSHIP_L,
+       SS_CARGOSHIP,
+       SS_CARGOSHIP_L,
+       SS_SLAVETRANSPORT,
+       SS_SLAVETRANSPORT_L,
+       SS_BARRIER,
+       SS_MOBILESHIELD,
+       SS_MOBILESHIELD_L,
+       SS_ASTEROID,
+       SS_ASTEROID_SMALL,
+       SS_ASTEROID_SMALL_L,
+       SS_CLOAKFIGHTER,
+       SS_CLOAKFIGHTER_L,
+       SS_EVILURSULA,
+       SS_EVILURSULA_L,
+       SS_KRASS,
+       SS_KRASS_L,
+       SS_FRIGATE,
+       SS_FRIGATE_L,
+       SS_FRIGATE_WING1,
+       SS_FRIGATE_WING1_L,
+       SS_FRIGATE_WING2,
+       SS_FRIGATE_WING2_L,
+       SS_MINERBOSS,
+       SS_MINERBOSS_L,
+       SS_MINERBOSS_WING1,
+       SS_MINERBOSS_WING1_L,
+       SS_MINERBOSS_WING2,
+       SS_MINERBOSS_WING2_L,
+       SS_MINERBOSS_WING3,
+       SS_MINERBOSS_WING3_L,
+       SS_MINERBOSS_WING4,
+       SS_MINERBOSS_WING4_L,
+       SS_EXEC,
+       SS_EXEC_L,
+       SS_PLUTOBOSS,
+       SS_PLUTOBOSS_L,
+       SS_URANUSBOSS,
+       SS_URANUSBOSS_L,
+       SS_URANUSBOSS_WING1,
+       SS_URANUSBOSS_WING1_L,
+       SS_URANUSBOSS_WING2,
+       SS_URANUSBOSS_WING2_L,
+       SS_KLINE,
+       SS_KLINE_L,
+       SS_HIT_INDEX,
+       SS_MAX = SS_HIT_INDEX * 2
+};
+
+// Shop sprites
 enum {
+       SHOP_S_PRIMARY,
+       SHOP_S_POWERUP,
+       SHOP_S_SECONDARY,
+       SHOP_S_CATALOG,
+       SHOP_S_SHIP_INFO,
+       SHOP_S_ITEM_INFO,
+       SHOP_S_MAX
+};
 
-       TS_PRESENTS,
+// Text sprites
+enum {
+       // Main menu
+       TS_PRESENTS = MAX_INFOLINES,
        TS_AN_SDL_GAME,
        TS_START_NEW_GAME,
        TS_LOAD_GAME,
@@ -286,12 +514,72 @@ enum {
        TS_UNLIMITED_CASH,
        TS_UNLIMITED_TIME,
        TS_START_GAME,
-       TS_DIFFICULTY
+       TS_DIFFICULTY,
+
+       // Intermission
+       TS_CURRENT_SYSTEM,
+       TS_INFO_START_MISSION,
+       TS_INFO_GOTO,
+       TS_INFO_MAP,
+       TS_INFO_STATUS,
+       TS_INFO_SAVE_GAME,
+       TS_INFO_SHOP,
+       TS_INFO_COMMS,
+       TS_INFO_OPTIONS,
+       TS_INFO_EXIT,
+       TS_CURRENT_PLANET,
+       TS_DEST_PLANET,
+
+       // Status
+       TS_STATUS_HEADER,
+       TS_SHOTS_FIRED,
+       TS_HITS_SCORED,
+       TS_ACCURACY,
+       TS_OTHER_KILLS,
+       TS_CASH_EARNED,
+       TS_CHRIS_HEADER,
+       TS_CHRIS_KILLS,
+       TS_CHRIS_SHIELD_PICKUPS,
+       TS_CHRIS_PLASMA_PICKUPS,
+       TS_CHRIS_ROCKET_PICKUPS,
+       TS_CHRIS_POWERUP_PICKUPS,
+       TS_CHRIS_MINES_KILLED,
+       TS_CHRIS_SLAVES_RESCUED,
+       TS_PHOEBE_HEADER,
+       TS_PHOEBE_KILLS,
+       TS_PHOEBE_DEATHS,
+       TS_URSULA_HEADER,
+       TS_URSULA_KILLS,
+       TS_URSULA_DEATHS,
+       TS_STATUS_FOOTER,
+
+       // Mission
+       TS_RADIO,
+       TS_SHIELD,
+       TS_PLASMA_T,
+       TS_AMMO_T,
+       TS_TARGET,
+       TS_TARGET_SID,
+       TS_TARGET_PHOEBE,
+       TS_TARGET_KLINE,
+       TS_CASH_T,
+       TS_OBJECTIVES_T,
+       TS_TIME_T,
+       TS_POWER,
+       TS_OUTPUT,
+       TS_COOLER,
+       TS_PAUSED,
+       TS_TIME,
+       TS_PLASMA,
+       TS_AMMO,
+       TS_CASH,
+       TS_OBJECTIVES,
+
+       TS_MAX
 };
 
 // Menu types
 enum {
-
        MENU_MAIN,
        MENU_DIFFICULTY,
        MENU_LOAD,
@@ -301,7 +589,6 @@ enum {
 
 // Shop items
 enum {
-
        SHOP_PLASMA_MAX_OUTPUT,
        SHOP_PLASMA_MAX_DAMAGE,
        SHOP_PLASMA_MAX_RATE,
@@ -319,23 +606,22 @@ enum {
        SHOP_CHARGER,
        SHOP_DOUBLE_HOMING_MISSILES,
        SHOP_MICRO_HOMING_MISSILES,
-       MAX_SHOPITEMS
+       SHOP_MAX
 };
 
 // Font Colors
 enum {
-
        FONT_WHITE,
        FONT_RED,
        FONT_YELLOW,
        FONT_GREEN,
        FONT_CYAN,
-       FONT_OUTLINE // a dark blue color
+       FONT_OUTLINE, // a dark blue color
+       FONT_MAX
 };
 
 // Sounds
 enum {
-
        SFX_EXPLOSION,
        SFX_HIT,
        SFX_DEATH,
@@ -357,27 +643,64 @@ enum {
 
 // Sections
 enum {
-
        SECTION_TITLE,
        SECTION_INTERMISSION,
        SECTION_GAME
 };
 
-// Faces
+// Systems
 enum {
+       SYSTEM_SPIRIT,
+       SYSTEM_EYANANTH,
+       SYSTEM_MORDOR,
+       SYSTEM_SOL
+};
 
-       FACE_CHRIS = 90,
-       FACE_SID,
-       FACE_KRASS,
-       FACE_KLINE,
-       FACE_PHOEBE,
-       FACE_URSULA,
-       FACE_CREW
+// Planets (Spirit)
+enum {
+       PLANET_HAIL,
+       PLANET_CERADSE,
+       PLANET_HINSTAG,
+       PLANET_JOLDAR,
+       PLANET_MOEBO
 };
 
-// Missions
+// Planets (Eyananth)
+enum {
+       PLANET_NEROD,
+       PLANET_ALLEZ,
+       PLANET_URUSOR,
+       PLANET_DORIM,
+       PLANET_ELAMALE,
+       PLANET_RESCUESLAVES = 9 // For save compatibility
+};
+
+// Planets (Mordor)
 enum {
+       PLANET_ODEON,
+       PLANET_FELLON,
+       PLANET_SIVEDI,
+       PLANET_ALMARTHA,
+       PLANET_POSWIC,
+       PLANET_ELLESH,
+       PLANET_CLOAKFIGHTER = 9 // For save compatibility
+};
 
+// Planets (Sol)
+enum {
+       PLANET_MERCURY,
+       PLANET_VENUS,
+       PLANET_EARTH,
+       PLANET_MARS,
+       PLANET_JUPITER,
+       PLANET_SATURN,
+       PLANET_URANUS,
+       PLANET_NEPTUNE,
+       PLANET_PLUTO
+};
+
+// Missions
+enum {
        MISN_START,
        MISN_HAIL,
        MISN_CERADSE,
@@ -426,8 +749,8 @@ const char * const systemBackground[] = {
 };
 
 const int rate2reload[6] = {15, 15, 13, 11, 9, 7};
-const int screenWidth = 800;
-const int screenHeight = 600;
+const int screenWidth = SCREEN_WIDTH;
+const int screenHeight = SCREEN_HEIGHT;
 const int xViewBorder = 100;
 const int yViewBorder = 100;
 const float cameraMaxSpeed = 3.;
index 7dc7f8f..42f6e21 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -19,6 +19,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
+#include <sys/types.h>
+#include <pwd.h>
+#include <unistd.h>
+#include <errno.h>
+
 Engine engine;
 
 void engine_init()
@@ -69,3 +74,231 @@ void engine_init()
        engine.cheatAmmo = false;
        engine.cheatCash = false;
 }
+
+/*
+Something went wrong. This stops the game, present the error message and
+prompts the user to press space or ctrl to exit the game. This is unlikely to
+be seen by people unless something really stoopid happens!
+*/
+void engine_showError(int errorId, const char *name)
+{
+       screen_clear(black);
+
+       if (errorId != 2)
+       {
+               screen_renderString("A file error has occurred", -1, 200, FONT_RED);
+       }
+       else
+       {
+               printf("Couldn't create or write to directory '%s'\n", name);
+               exit(1);
+       }
+
+       char string[255];
+
+       switch(errorId)
+       {
+               case 0:
+                       sprintf(string, "%s was not found in the Starfighter data package", name);
+                       screen_renderString(string, -1, 250, FONT_WHITE);
+                       screen_renderString("Please try again. If this error persists, contact the authors", -1, 275, FONT_WHITE);
+                       screen_renderString("or reinstall the game", -1, 300, FONT_WHITE);
+                       break;
+               case 1:
+                       screen_renderString("Project: Starfighter encountered an error whilst", -1, 250, FONT_WHITE);
+                       screen_renderString("attempting to load game data. Please try running", -1, 275, FONT_WHITE);
+                       screen_renderString("the game again. If the errors persist, reinstall the game", -1, 300, FONT_WHITE);
+                       break;
+               case 2:
+                       screen_renderString("Project: Starfighter encountered a critical error", -1, 250, FONT_WHITE);
+                       screen_renderString("while attempting to perform a required program function.", -1, 275, FONT_WHITE);
+                       screen_renderString("Please contact the authors with details.", -1, 300, FONT_WHITE);
+                       break;
+       }
+
+       screen_renderString("Project: Starfighter will now exit", -1, 450, FONT_WHITE);
+       screen_renderString("Press Space to continue", -1, 475, FONT_WHITE);
+
+       renderer_update();
+
+       engine.keyState[KEY_ALTFIRE] = 0;
+
+       while (!engine.keyState[KEY_ALTFIRE])
+       {
+               getPlayerInput();
+               game_delayFrame();
+       }
+
+       exit(1);
+}
+
+/*
+This gets the user's home directory, then creates the config directory.
+*/
+void engine_setupConfigDirectory()
+{
+       const char *userHome;
+
+       if ((userHome = getenv("HOME")) == NULL)
+               userHome = getpwuid(getuid())->pw_dir;
+
+       char dir[PATH_MAX];
+       strcpy(dir, "");
+
+       sprintf(dir, "%s/.config", userHome);
+       if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
+               engine_showError(2, dir);
+
+       sprintf(dir, "%s/.config/starfighter", userHome);
+       if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
+               engine_showError(2, dir);
+
+       sprintf(engine.configDirectory, "%s/.config/starfighter/", userHome);
+}
+
+/*
+This sets up the video and sound system, and creates Starfighter's window.
+*/
+void engine_setMode()
+{
+       strcpy(engine.configDirectory, "");
+
+       engine_setupConfigDirectory();
+
+       /* Initialize the SDL library */
+       if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
+       {
+               printf("Couldn't initialize SDL: %s\n", SDL_GetError());
+               exit(1);
+       }
+
+       char filename[PATH_MAX];
+       int fullScreen = 0;
+       int useSound = 1;
+       int useMusic = 1;
+       int autoPause = 0;
+
+       FILE *fp;
+       sprintf(filename, "%sconf", engine.configDirectory);
+       fp = fopen(filename, "rb");
+
+       if (fp != NULL)
+       {
+               if (fscanf(fp, "%d %d %d %d", &fullScreen, &useSound, &useMusic, &autoPause) < 4)
+                       printf("Warning: Config file \"%s\" is not correctly formatted\n", filename);
+               fclose(fp);
+       }
+
+       engine.fullScreen = fullScreen;
+       engine.useSound = useSound;
+       engine.useMusic = useMusic;
+       engine.autoPause = autoPause;
+
+       screen = SDL_CreateRGBSurface(0, screenWidth, screenHeight, 32, 0xff0000, 0xff00, 0xff, 0xff000000);
+
+       if (!screen)
+       {
+               printf("Couldn't create %ix%ix32 surface: %s\n", screenWidth, screenHeight, SDL_GetError());
+               exit(1);
+       }
+
+       window = SDL_CreateWindow("Project: Starfighter", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, screen->w, screen->h, 0);
+
+       if (window == NULL)
+       {
+               printf("Could not create window: %s\n", SDL_GetError());
+               exit(1);
+       }
+
+       SDL_SetWindowIcon(window, gfx_loadImage("gfx/alienDevice.png"));
+       SDL_SetWindowFullscreen(window, engine.fullScreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
+
+       renderer = SDL_CreateRenderer(window, -1, 0);
+
+       if (!renderer)
+       {
+               printf("Could not create renderer: %s\n", SDL_GetError());
+               exit(1);
+       }
+
+       SDL_RenderSetLogicalSize(renderer, screen->w, screen->h);
+
+       renderer_texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen->w, screen->h);
+
+       if (!renderer_texture)
+       {
+               printf("Couldn't create %ix%ix32 texture: %s\n", screen->w, screen->h, SDL_GetError());
+               exit(1);
+       }
+
+       if (engine.useAudio)
+       {
+               if (Mix_OpenAudio(44100, AUDIO_S16, engine.useAudio * 2, 1024) < 0)
+               {
+                       printf("Warning: Couldn't set 44100 Hz 16-bit stereo audio - Reason:\n%s\n", Mix_GetError());
+                       printf("Sound and Music will be disabled\n");
+                       engine.useAudio = false;
+               }
+       }
+
+       SDL_ShowCursor(SDL_DISABLE);
+       SDL_EventState(SDL_MOUSEMOTION, SDL_DISABLE);
+
+       SDL_JoystickEventState(SDL_ENABLE);
+       SDL_JoystickOpen(0);
+}
+
+/*
+Removes [hopefully] all the resources that has been
+loaded and created during the game. This is called by
+atexit();
+*/
+void engine_cleanup()
+{
+       gfx_free();
+       SDL_FreeSurface(gfx_background);
+       audio_free();
+       resetLists();
+       delete(engine.bulletHead);
+       delete(engine.explosionHead);
+       delete(engine.collectableHead);
+       delete(screen_bufferHead);
+
+       for (int i = 0 ; i < FONT_MAX ; i++)
+       {
+               if (gfx_fontSprites[i] != NULL)
+                       SDL_FreeSurface(gfx_fontSprites[i]);
+       }
+
+       char filename[PATH_MAX];
+       strcpy(filename, "");
+       
+       sprintf(filename, "%smusic.mod", engine.configDirectory);
+       remove(filename);
+
+       sprintf(filename, "%smusic.s3m", engine.configDirectory);
+       remove(filename);
+
+       if (engine.useAudio)
+       {
+               Mix_CloseAudio();
+       }
+
+       // Save the config using current settings
+       FILE *fp;
+       sprintf(filename, "%sconf", engine.configDirectory);
+       fp = fopen(filename, "wb");
+       if (fp != NULL)
+       {
+               fprintf(fp, "%d %d %d %d\n", engine.fullScreen, engine.useSound,
+                       engine.useMusic, engine.autoPause);
+               fclose(fp);
+       }
+       else
+       {
+               printf("Error saving config\n");
+       }
+
+       SDL_Quit();
+       printf("Thank You for playing Starfighter\n");
+}
index 4f510f5..52cc990 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -20,8 +20,95 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef GLOBALS_H
 #define GLOBALS_H
 
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
+
+
+typedef struct Engine_ {
+
+       SDL_Event event;
+       int done;
+
+       SDL_RWops *sdlrw;
+
+       float musicVolume;
+
+       int maxAliens;
+
+       float ssx;
+       float ssy;
+       float smx;
+       float smy;
+
+       object *bulletHead;
+       object *bulletTail;
+       object *explosionHead;
+       object *explosionTail;
+       collectables *collectableHead;
+       collectables *collectableTail;
+       object *debrisHead;
+       object *debrisTail;
+
+       int cursor_x, cursor_y;
+
+       int commsSection;
+
+       int eventTimer;
+
+       int lowShield;
+       int averageShield;
+
+       float targetShield;
+       int targetIndex;
+
+       // Mission completion timer (allows for 4 seconds before leaving sector)
+       Uint32 missionCompleteTimer;
+
+       // Times the mission normally
+       Uint32 counter2;
+       long timeTaken; // In seconds
+
+       // For missions with a time limit
+       int timeMission;
+       Uint32 counter;
+       int seconds;
+       int minutes;
+
+       // Mission Related stuff
+       int allAliensDead;
+       int addAliens;
+
+       bool paused;
+       int gameSection;
+
+       bool useAudio;
+       bool useSound;
+       bool useMusic;
+       bool fullScreen;
+       bool autoPause;
+
+       char configDirectory[1024];
+       
+       char keyState[KEY_LAST];
+
+       bool cheat; // overall cheat
+       bool cheatShield;
+       bool cheatCash;
+       bool cheatAmmo;
+       bool cheatTime;
+       bool cheatCredits;
+
+} Engine;
+
+
 extern Engine engine;
 
 void engine_init();
+void engine_showError(int errorId, const char *name);
+void engine_setupConfigDirectory();
+void engine_setMode();
+void engine_cleanup();
 
 #endif
diff --git a/src/event.cpp b/src/event.cpp
new file mode 100644 (file)
index 0000000..4d89c23
--- /dev/null
@@ -0,0 +1,374 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "Starfighter.h"
+
+static Event events[MAX_EVENTS];
+static const char *klineGreeting[] = {
+       "¤Þ¤¿²ñ¤¨¤¿¤Ê¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É!",
+       "È¿µÕ¼Ô¤è¡¢¤³¤ì¤Ç½ª¤ï¤ê¤À!",
+       "º£²ó¤Ï¼ºË¾¤µ¤»¤Ê¤¤¤Ç¤¯¤ì¡Ä",
+       "»ä¤òÅݤ»¤ë¤È»×¤Ã¤Æ¤¤¤ë¤Î¤«?!"
+};
+
+void events_init()
+{
+       for (int i = 0 ; i < MAX_EVENTS ; i++)
+       {
+               events[i].time = 0;
+               events[i].face = -1;
+               strcpy(events[i].message, "");
+               events[i].entity = -1;
+               events[i].flag = 0;
+       }
+
+       switch (game.area)
+       {
+               case MISN_INTERCEPTION:
+                       if ((aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
+                                       (aliens[ALIEN_KLINE].active))
+                               events[0].time = 2;
+                               events[0].face = FS_KLINE;
+                               strcpy(events[0].message, klineGreeting[rand() % 4]);
+
+                       break;
+
+               case MISN_MOEBO:
+                       events[0].time = 2;
+                       events[0].face = FS_SID;
+                       strcpy(events[0].message, "¤Þ¤º¥Õ¥ê¥²¡¼¥È¤ÎÉðÁõ¤òÇ˲õ¤·¤í¡£¤½¤ì¤¬½õ¤±¤Ë¤Ê¤ë!");
+
+                       events[1].time = 120;
+                       events[1].face = FS_SID;
+                       strcpy(events[1].message, "¥¯¥ê¥¹¡¢µÞ¤²! ¥Õ¥ê¥²¡¼¥È¤Ï¤â¤¦¤¹¤°¼ÍÄøÆâ¤À!");
+
+                       events[2].time = 150;
+                       events[2].face = FS_SID;
+                       strcpy(events[2].message, "¥Õ¥ê¥²¡¼¥È¤Ï¥«¥Î¥óˤ¤òÁõŶ¤·¤Æ¤¤¤ë!");
+
+                       events[3].time = 170;
+                       events[3].face = FS_SID;
+                       strcpy(events[3].message, "¥¯¥ê¥¹¡¢Á᤯¤·¤í!!!");
+
+                       events[4].time = 180;
+                       events[4].face = FS_SID;
+                       strcpy(events[4].message, "²¿¤È¤¤¤¦¤³¤È¤À¡Ä");
+                       events[4].entity = ALIEN_BOSS;
+                       events[4].flag = FL_LEAVESECTOR | FL_IMMORTAL;
+
+                       break;
+
+               case MISN_NEROD:
+                       events[0].time = 2;
+                       events[0].face = FS_PHOEBE;
+                       strcpy(events[0].message, "¤³¤Ã¤Á¤è! ¤³¤Î¥ï¥¤¥ä¡¼¤òÀÚ¤ì¤ÐÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤ë¤ï!");
+
+                       break;
+
+               case MISN_ALLEZ:
+                       events[0].time = 2;
+                       events[0].face = FS_CREW;
+                       strcpy(events[0].message, "¿À¤Ë´¶¼Õ¤À! ¤¿¤Î¤à¡¢½õ¤±¤Æ¤¯¤ì! ¤â¤·¤³¤ÎÁ¥¤¬Ç˲õ¤µ¤ì¤¿¤é¡Ä");
+
+                       events[1].time = 6;
+                       events[1].face = FS_CHRIS;
+                       strcpy(events[1].message, "¤É¤Î¤¯¤é¤¤¤Î»þ´Ö¤¬É¬ÍפÀ?");
+
+                       events[2].time = 10;
+                       events[2].face = FS_CREW;
+                       strcpy(events[2].message, "2¡¢3ʬ¤À!");
+
+                       events[3].time = 60;
+                       events[3].face = FS_CREW;
+                       strcpy(events[3].message, "¤è¤·! Éð´ï¤Ï»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿! ¸å¤Ï¥¨¥ó¥¸¥ó¤À¡Ä");
+                       events[3].entity = ALIEN_FRIEND1;
+                       events[3].flag = -FL_NOFIRE;
+
+                       events[4].time = 80;
+                       events[4].face = FS_CREW;
+                       strcpy(events[4].message, "¥¯¥½¥Ã! ¤Þ¤¿Éð´ï¤¬¥À¥á¤Ë¤Ê¤Ã¤¿! ¤É¤¦¤¹¤ê¤ã¤¤¤¤¤ó¤À?!");
+                       events[4].entity = ALIEN_FRIEND1;
+                       events[4].flag = FL_NOFIRE;
+
+                       events[5].time = 100;
+                       events[5].face = FS_CREW;
+                       strcpy(events[5].message, "¥¯¥ê¥¹¡¢½õ¤±¤Æ¤¯¤ì!! Á´¥·¥¹¥Æ¥à¤¬¥À¥¦¥ó¤À! Á´°÷¥Ç¥Ã¥­¤ÇÆ°¤±¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë!");
+                       events[5].entity = ALIEN_FRIEND1;
+                       events[5].flag = FL_DISABLED;
+
+                       events[6].time = 120;
+                       events[6].face = FS_CREW;
+                       strcpy(events[6].message, "¤â¤¦¾¯¤·¤À¡Ä");
+
+                       events[7].time = 140;
+                       events[7].face = FS_CREW;
+                       strcpy(events[7].message, "OK! ²óÉü¤·¤¿¡£¸å¤Ï¥¨¥ó¥¸¥ó¤ÎÌäÂ꤬ʬ¤«¤ì¤Ð¡Ä");
+                       events[7].entity = ALIEN_FRIEND1;
+                       events[7].flag = -FL_DISABLED;
+
+                       events[8].time = 177;
+                       events[8].face = FS_CREW;
+                       strcpy(events[8].message, "¥¨¥ó¥¸¥ó¤Î½¤Íý´°Î»! È¯¿Ê!");
+
+                       events[9].time = 180;
+                       events[9].entity = ALIEN_FRIEND1;
+                       events[9].flag = FL_LEAVESECTOR | FL_IMMORTAL;
+
+                       break;
+
+               case MISN_ELAMALE:
+                       events[0].time = 5;
+                       events[0].face = FS_PHOEBE;
+                       strcpy(events[0].message, "²¿¤«¤¬¤ª¤«¤·¤¤¡Ä! ¤â¤Ã¤È¸î±Ò¤¬¤¤¤Æ¤â¤¤¤¤¤Ï¤º!");
+
+                       events[1].time = -8;
+                       events[1].face = FS_PHOEBE;
+                       strcpy(events[1].message, "¥¯¥Ã! æ«¤è! Íè¤Æ¡¢¥¯¥ê¥¹¡¢¤³¤³¤òÎ¥¤ì¤Þ¤·¤ç¤¦!!");
+
+                       events[2].time = -9;
+                       events[2].entity = ALIEN_PHOEBE;
+                       events[2].flag = FL_LEAVESECTOR;
+
+                       events[3].time = -13;
+                       events[3].face = FS_SID;
+                       strcpy(events[3].message, "¥¯¥ê¥¹¡¢¤É¤¦¤·¡Ä¤¿¡Ä¡Ä");
+
+                       events[4].time = -15;
+                       events[4].face = FS_KLINE;
+                       strcpy(events[4].message, "¤Ä¤¤¤ËºÇ¤â´í¸±¤ÊÃˤ˲ñ¤¨¤¿!");
+
+                       events[5].time = -20;
+                       events[5].face = FS_CHRIS;
+                       strcpy(events[5].message, "¥ï¡¼¥×¥É¥é¥¤¥Ö¤Î¤È¤­¤Îº®Àþ¤Ç¸«¤«¤±¤¿¤Ê¡£Ã¯¤À?");
+
+                       events[6].time = -25;
+                       events[6].face = FS_KLINE;
+                       strcpy(events[6].message, "»ä¤Ï¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó¡£¤½¤Î¾®¤µ¤Ê¥Ü¥íÁ¥¤ò»ß¤á¤ËÍ褿!");
+
+                       events[7].time = -31;
+                       events[7].face = FS_CHRIS;
+                       strcpy(events[7].message, "¥¯¥é¥¤¥ó¡¦¥±¥¹¥é¥ó? ¥Õ¥ó¡¢¤º¤¤¤Ö¤ó¤È¼«¿®¤¬¤¢¤ë¤è¤¦¤À¤Ê¡£");
+
+                       events[8].time = -36;
+                       events[8].face = FS_KLINE;
+                       strcpy(events[8].message, "ƨ¤²¤ë¾ì½ê¤â¤Ê¤¯¡¢±£¤ì¤ë¾ì½ê¤â¤Ê¤¯¡¢¤½¤·¤Æ½õ¤±¤â¤¤¤Ê¤¤! ¤É¤¦¤¹¤ë¤«³Ú¤·¤ß¤À¡Ä");
+
+                       events[9].time = -42;
+                       events[9].entity = ALIEN_KLINE;
+                       events[9].flag = -(FL_IMMORTAL | FL_NOFIRE);
+
+                       break;
+
+               case MISN_ODEON:
+                       events[0].time = 2;
+                       events[0].face = FS_URSULA;
+                       strcpy(events[0].message, "½ê°ÉÔÌÀ¤Î´ÏÁ¥¤òȯ¸«¡£¤¿¤À¤Á¤ËÌÜɸ¤òÇ˲õ¤¹¤ë¡£");
+
+                       events[1].time = 8;
+                       events[1].face = FS_CHRIS;
+                       strcpy(events[1].message, "»Ð¤µ¤ó¤âͶƳ¥ß¥µ¥¤¥ë¥é¥ó¥Á¥ã¡¼¤ò»ý¤Ã¤Æ¤¤¤ë¤è¤¦¤À! ¥Õ¥§¡¼¥Ù¡¢²¿¤«¥¢¥É¥Ð¥¤¥¹¤Ï¤¢¤ë¤«?");
+
+                       events[2].time = 14;
+                       events[2].face = FS_PHOEBE;
+                       strcpy(events[2].message, "¤¬¤ó¤Ð¤Ã¤ÆÈò¤±¤ë¤·¤«¤Ê¤¤¤ï!");
+
+                       break;
+
+               case MISN_ALMARTHA:
+                       events[0].time = 1;
+                       events[0].face = FS_CHRIS;
+                       strcpy(events[0].message, "¤¤¤¤´Ï¤À!");
+
+                       events[1].time = 7;
+                       events[1].face = FS_KRASS;
+                       strcpy(events[1].message, "¤½¤¦¤À¤í¤¦¡¢¾®ÁΡ£²¶¤¬ºî¤Ã¤¿¤ó¤À¤«¤é¤Ê!");
+
+                       events[2].time = 60;
+                       events[2].face = FS_KRASS;
+                       strcpy(events[2].message, "¤ª¤Ã¤È¾®ÁΡ¢¸½¤ì¤ä¤¬¤Ã¤¿¤¾! ¤É¤¦¤â¤ªÁ°¤Î¥À¥Á¤É¤â¤Ï¤¦¤Þ¤¯¤¤¤Ã¤Æ¤Ê¤¤¤è¤¦¤À¤Ê!");
+                       events[2].entity = ALIEN_BOSS_PART1;
+                       events[2].flag = -FL_ACTIVATE;
+
+                       events[3].time = 90;
+                       events[3].entity = ALIEN_BOSS_PART2;
+                       events[3].flag = -FL_ACTIVATE;
+
+                       events[4].time = 93;
+                       events[4].face = FS_KRASS;
+                       strcpy(events[4].message, "¤³¤¤¤Ä¤é¤ò²¶¤Î¸å¤í¤Ë¶á¤Å¤±¤ë¤Ê¡£¤µ¤â¤Ê¤¤¤È³ä¤êÁý¤·¤ò¼è¤ë¤¾!!!");
+
+                       events[5].time = 120;
+                       events[5].entity = ALIEN_BOSS_PART3;
+                       events[5].flag = -FL_ACTIVATE;
+
+                       events[6].time = 140;
+                       events[6].face = FS_PHOEBE;
+                       strcpy(events[6].message, "¤Á¤ç¤Ã¤È!! ²¿¤·¤Æ¤ë¤Î?");
+                       events[6].entity = ALIEN_PHOEBE;
+                       events[6].flag = -FL_ACTIVATE;
+
+                       events[7].time = 140;
+                       events[7].entity = ALIEN_URSULA;
+                       events[7].flag = -FL_ACTIVATE;
+
+                       events[8].time = 150;
+                       events[8].face = FS_KRASS;
+                       strcpy(events[8].message, "²¶¤Ï½½Ê¬¤Ë²Ô¤¤¤À¡£¤¸¤ã¤¢¤Ê¾®ÁÎ!");
+                       events[8].entity = ALIEN_FRIEND1;
+                       events[8].flag = FL_LEAVESECTOR;
+
+                       break;
+
+               case MISN_POSWIC:
+                       events[0].time = 90;
+                       events[0].face = FS_SID;
+                       strcpy(events[0].message, "¥¯¥½¥Ã! Æ¨¤²¤è¤¦¤È¤·¤Æ¤¤¤ë¤¾! »ß¤á¤ë¤ó¤À!");
+                       events[0].entity = ALIEN_BOSS;
+                       events[0].flag = FL_LEAVESECTOR;
+
+                       break;
+
+               case MISN_SATURN:
+                       events[0].time = 45;
+                       events[0].face = FS_SID;
+                       strcpy(events[0].message, "¥¯¥ê¥¹! Ê̤Î2µ¡¤Î¥ì¡¼¥¶¡¼Ë¤¤¬Îΰè¤Ë¶á¤Å¤¤¤Æ¤¤¤ë¤¾!");
+                       events[0].entity = ALIEN_BOSS_PART3;
+                       events[0].flag = -FL_ACTIVATE;
+
+                       events[1].time = 45;
+                       events[1].entity = ALIEN_BOSS_PART4;
+                       events[1].flag = -FL_ACTIVATE;
+
+                       events[2].time = 90;
+                       events[2].face = FS_SID;
+                       strcpy(events[2].message, "2µ¡ÅþÃ夷¤¿!");
+                       events[2].entity = ALIEN_BOSS_PART5;
+                       events[2].flag = -FL_ACTIVATE;
+
+                       events[3].time = 90;
+                       events[3].entity = ALIEN_BOSS_PART6;
+                       events[3].flag = -FL_ACTIVATE;
+
+                       break;
+
+               case MISN_JUPITER:
+                       events[0].time = 1;
+                       events[0].entity = ALIEN_BOSS_PART1;
+                       events[0].flag = -FL_ACTIVATE;
+
+                       events[1].time = 2;
+                       events[1].face = FS_URSULA;
+                       strcpy(events[1].message, "櫤À! ²¿¤È¤¤¤¦¤³¤È¤À! ¥¿¥¤¥é¡¼¤á!");
+
+                       events[2].time = 8;
+                       events[2].face = FS_KRASS;
+                       strcpy(events[2].message, "²¶¤Ï¸Û¤ï¤ì¤À¡£²¿¤ò´üÂÔ¤·¤Æ¤¤¤¿¤ó¤À?! WEAPCO¤Ï¤ªÁ°¤é¤ÈƱ¤¸¤è¤¦¤Ë²¶¤ò¸Û¤Ã¤¿¤À¤±¤À¡£");
+
+                       events[3].time = 14;
+                       events[3].face = FS_CHRIS;
+                       strcpy(events[3].message, "¤½¤¦¤À¤Ê¡£¤ªÁ°¤Ë²¿¤«´üÂÔ¤·¤¿²¶¤¬¥Ð¥«¤À¤Ã¤¿¤è¡£");
+
+                       events[4].time = 15;
+                       events[4].entity = ALIEN_BOSS_PART2;
+                       events[4].flag = -FL_ACTIVATE;
+
+                       events[5].time = 20;
+                       events[5].face = FS_KRASS;
+                       strcpy(events[5].message, "¤µ¤¢Á᤯¤¯¤¿¤Ð¤ì¡£¾®Àڼ꤬ÂԤäƤë¤ó¤À¡¢¾®ÁΡġ£");
+
+                       events[6].time = 25;
+                       events[6].face = FS_CHRIS;
+                       strcpy(events[6].message, "²¶¤Ë¤â̾Á°¤¬¤¢¤ë¡£ÃΤé¤Í¤¨¤Î¤«?");
+
+                       events[7].time = 45;
+                       events[7].entity = ALIEN_BOSS_PART3;
+                       events[7].flag = -FL_ACTIVATE;
+
+                       events[8].time = 45;
+                       events[8].entity = ALIEN_BOSS_PART4;
+                       events[8].flag = -FL_ACTIVATE;
+
+                       break;
+
+               case MISN_EARTH:
+                       events[0].time = 2;
+                       events[0].face = FS_KLINE;
+                       strcpy(events[0].message, "¤³¤ì¤Ç½ª¤ï¤ê¤À¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£¤¿¤¤¤·¤¿°­±¿¤À¤Ã¤¿¤¬¡¢¤½¤ì¤â¤â¤¦¿Ô¤­²Ì¤Æ¤¿!");
+
+                       events[1].time = 8;
+                       events[1].face = FS_CHRIS;
+                       strcpy(events[1].message, "¤½¤ÎÄ̤ê¤À! ¤ªÁ°¤Ë¤Ï¤º¤Ã¤Èƨ¤²¤é¤ì¤Æ¤¿¤«¤é¤Ê!");
+
+                       break;
+
+               case MISN_VENUS:
+                       events[0].time = 2;
+                       events[0].face = FS_CHRIS;
+                       strcpy(events[0].message, "WEAPCO¤Ï½ª¤ï¤Ã¤¿¡¢¥±¥¹¥é¥ó! ¤ªÁ°¤Ë¤Ïƨ¤²¤ë¾ì½ê¤â¡¢±£¤ì¤ë¾ì½ê¤â¡¢½õ¤±¤â¤Ê¤¤¡£");
+
+                       events[1].time = 8;
+                       events[1].face = FS_KLINE;
+                       strcpy(events[1].message, "¤ªÁ°¤Ï»ä¤ò¸«¤¯¤Ó¤Ã¤Æ¤¤¤ë¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É¡£");
+
+                       break;
+       }
+}
+
+void events_check()
+{
+       for (int i = 0 ; i < MAX_EVENTS ; i++)
+       {
+               if (engine.timeTaken == events[i].time)
+               {
+                       if (strcmp(events[i].message, "") != 0)
+                       {
+                               setRadioMessage(events[i].face, events[i].message, 1);
+                       }
+
+                       if (events[i].entity > -1)
+                       {
+                               if (events[i].flag != -FL_ACTIVATE)
+                               {
+                                       aliens[events[i].entity].flags += events[i].flag;
+                               }
+                               else
+                               {
+                                       aliens[events[i].entity].active = true;
+                                       aliens[events[i].entity].x = ((int)player.x +
+                                               RANDRANGE(400, 800));
+                                       aliens[events[i].entity].y = ((int)player.y +
+                                               RANDRANGE(-400, 800));
+                               }
+                       }
+
+                       events[i].time = 0;
+               }
+       }
+}
+
+void events_sync()
+{
+       for (int i = 0 ; i < MAX_EVENTS ; i++)
+       {
+               if (events[i].time < 0)
+               {
+                       events[i].time = engine.timeTaken + abs(events[i].time);
+               }
+       }
+}
diff --git a/src/event.h b/src/event.h
new file mode 100644 (file)
index 0000000..01b44f5
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef EVENT_H
+#define EVENT_H
+
+typedef struct Event_ {
+
+       int time;
+       int face;
+       char message[255];
+       int entity;
+       int flag;
+
+} Event;
+
+void events_init();
+void events_check();
+void events_sync();
+
+#endif
index d56eef7..064cc09 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -35,7 +35,7 @@ void explosion_add(float x, float y, int type)
        explosion->y = y;
        explosion->thinktime = 28;
        explosion->face = type;
-       explosion->image[0] = shape[type];
+       explosion->image[0] = gfx_sprites[type];
 
        engine.explosionTail->next = explosion;
        engine.explosionTail = explosion;
@@ -47,12 +47,12 @@ void explosion_add(float x, float y, int type)
 */
 void explosion_addEngine(object *craft)
 {
-       if (rand() % 2 == 0)
+       if (CHANCE(0.5))
                return;
 
        float x = craft->x + (craft->engineX * craft->face);
        float y = craft->y + craft->engineY;
 
        y += RANDRANGE(-3, 3);
-       explosion_add(x, y, E_TINY_EXPLOSION);
+       explosion_add(x, y, SP_TINY_EXPLOSION);
 }
index 95b80a7..c59799e 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index 9559568..d36882d 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2014, 2015 Julian Marchant
+Copyright (C) 2012, 2014, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -21,9 +21,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 Game game;
 
+static Star stars[STARS_NUM];
+static Uint32 frameLimit = 0;
+static int thirds = 0;
+
 void game_init()
 {
-       game.system = 0;
+       game.system = SYSTEM_SPIRIT;
        game.area = MISN_START;
        game.sfxVolume = 0;
        game.musicVolume = 0;
@@ -124,6 +128,13 @@ void game_init()
        player.weaponType[0] = W_PLAYER_WEAPON;
        player.weaponType[1] = W_ROCKETS;
 
+       for (int i = 0 ; i < STARS_NUM ; i++)
+       {
+               stars[i].x = rand() % screen->w;
+               stars[i].y = rand() % screen->h;
+               stars[i].speed = 1 + (rand() % 3);
+       }
+
        initWeapons();
        initMissions();
        initPlanetMissions(game.system);
@@ -132,9 +143,9 @@ void game_init()
 static void game_addDebris(int x, int y, int amount)
 {
        if ((rand() % 2) == 0)
-               audio_playSound(SFX_DEBRIS, x);
+               audio_playSound(SFX_DEBRIS, x, y);
        else
-               audio_playSound(SFX_DEBRIS2, x);
+               audio_playSound(SFX_DEBRIS2, x, y);
 
        object *debris;
        
@@ -166,6 +177,52 @@ static void game_addDebris(int x, int y, int amount)
 }
 
 /*
+Simply draws the stars in their positions on screen and moves
+them around.
+*/
+void game_doStars()
+{
+       /* Lock the screen for direct access to the pixels */
+       if (SDL_MUSTLOCK(screen))
+       {
+               if (SDL_LockSurface(screen) < 0)
+                       engine_showError(2, "");
+       }
+
+       int color = 0;
+
+       SDL_Rect r;
+
+       for (int i = 0 ; i < STARS_NUM ; i++)
+       {
+               if (stars[i].speed == 3)
+                       color = white;
+               else if (stars[i].speed == 2)
+                       color = lightGrey;
+               else if (stars[i].speed == 1)
+                       color = darkGrey;
+
+               WRAP_ADD(stars[i].x, (engine.ssx + engine.smx) * stars[i].speed, 0,
+                       screen->w - 1);
+               WRAP_ADD(stars[i].y, (engine.ssy + engine.smy) * stars[i].speed, 0,
+                       screen->h - 1);
+
+               gfx_putPixel(screen, (int)stars[i].x, (int)stars[i].y, color);
+               r.x = (int)stars[i].x;
+               r.y = (int)stars[i].y;
+               r.w = 1;
+               r.h = 1;
+
+               screen_addBuffer(r.x, r.y, r.w, r.h);
+       }
+
+       if (SDL_MUSTLOCK(screen))
+       {
+               SDL_UnlockSurface(screen);
+       }
+}
+
+/*
 Loops through the currently active collectables (in a linked list). The collectable
 will travel in the direction that was defined when it was made. Its life will decreased
 whilst it remains active. It will be removed if the player touches it or if its life
@@ -189,7 +246,7 @@ static void game_doCollectables()
                                        (collectable->x < screen->w) &&
                                        (collectable->y + collectable->image->h > 0) &&
                                        (collectable->y < screen->h))
-                               blit(collectable->image, (int)collectable->x, (int)collectable->y);
+                               screen_blit(collectable->image, (int)collectable->x, (int)collectable->y);
 
                        collectable->x += engine.ssx + engine.smx;
                        collectable->y += engine.ssy + engine.smy;
@@ -198,24 +255,24 @@ static void game_doCollectables()
 
                        collectable->life--;
 
-                       if ((player.shield > 0) && (collision(collectable, &player)))
+                       if ((player.shield > 0) && (collectable_collision(collectable, &player)))
                        {
                                switch(collectable->type)
                                {
                                        case P_CASH:
                                                if (game.difficulty == DIFFICULTY_ORIGINAL)
-                                                       collectable->value *= 2;
+                                                       collectable->value = collectable->value * 3 / 2;
 
                                                game.cash += collectable->value;
                                                game.cashEarned += collectable->value;
-                                               sprintf(temp, "$%d ³ÍÆÀ", collectable->value);
+                                               sprintf(temp, "$%d ³ÍÆÀ ", collectable->value);
                                                break;
 
                                        case P_ROCKET:
                                                LIMIT_ADD(player.ammo[1], collectable->value, 0,
                                                        game.maxRocketAmmo);
                                                if (player.ammo[1] == game.maxRocketAmmo)
-                                                       sprintf(temp, "¥í¥±¥Ã¥ÈÃÆ ºÇÂç");
+                                                       sprintf(temp, "¥í¥±¥Ã¥ÈÃÆ ´û¤ËºÇÂç");
                                                else
                                                {
                                                        if (collectable->value > 1)
@@ -234,17 +291,22 @@ static void game_doCollectables()
 
                                        case P_PLASMA_RATE:
                                                game.powerups++;
-                                               if ((game.area != MISN_INTERCEPTION) ||
-                                                       (game.difficulty == DIFFICULTY_ORIGINAL) ||
-                                                       (player.ammo[0] > 0))
+                                               if (game.difficulty == DIFFICULTY_ORIGINAL)
+                                               {
+                                                       player.ammo[0] = MAX(player.ammo[0], 50);
+                                                       weapon[W_PLAYER_WEAPON].reload[0] = MAX(
+                                                               rate2reload[game.maxPlasmaRate],
+                                                               weapon[W_PLAYER_WEAPON].reload[0] - 2);
+                                               }
+                                               else if ((game.area != MISN_INTERCEPTION) ||
+                                                               (player.ammo[0] > 0))
                                                {
-                                                       if ((game.area != MISN_INTERCEPTION) ||
-                                                                       (game.difficulty == DIFFICULTY_ORIGINAL))
+                                                       if (game.area != MISN_INTERCEPTION)
                                                                LIMIT_ADD(player.ammo[0], collectable->value,
                                                                        0, game.maxPlasmaAmmo);
 
                                                        if (weapon[W_PLAYER_WEAPON].reload[0] <= rate2reload[game.maxPlasmaRate])
-                                                               sprintf(temp, "Ï¢¼Í®ÅÙ ºÇÂç");
+                                                               sprintf(temp, "Ï¢¼Í®ÅÙ ´û¤ËºÇÂç");
                                                        else
                                                        {
                                                                weapon[W_PLAYER_WEAPON].reload[0] -= 2;
@@ -259,17 +321,21 @@ static void game_doCollectables()
 
                                        case P_PLASMA_SHOT:
                                                game.powerups++;
-                                               if ((game.area != MISN_INTERCEPTION) ||
-                                                       (game.difficulty == DIFFICULTY_ORIGINAL) ||
-                                                       (player.ammo[0] > 0))
+                                               if (game.difficulty == DIFFICULTY_ORIGINAL)
+                                               {
+                                                       player.ammo[0] = MAX(player.ammo[0], 50);
+                                                       weapon[W_PLAYER_WEAPON].ammo[0] = MIN(
+                                                               game.maxPlasmaOutput, weapon[W_PLAYER_WEAPON].ammo[0] + 1);
+                                               }
+                                               else if ((game.area != MISN_INTERCEPTION) ||
+                                                               (player.ammo[0] > 0))
                                                {
-                                                       if ((game.area != MISN_INTERCEPTION) ||
-                                                                       (game.difficulty == DIFFICULTY_ORIGINAL))
+                                                       if (game.area != MISN_INTERCEPTION)
                                                                LIMIT_ADD(player.ammo[0], collectable->value,
                                                                        0, game.maxPlasmaAmmo);
 
                                                        if (weapon[W_PLAYER_WEAPON].ammo[0] >= game.maxPlasmaOutput)
-                                                               sprintf(temp, "½ÐÎÏÈÏ°Ï ºÇÂç");
+                                                               sprintf(temp, "½ÐÎÏÈÏ°Ï ´û¤ËºÇÂç");
                                                        else
                                                        {
                                                                weapon[W_PLAYER_WEAPON].ammo[0]++;
@@ -284,18 +350,23 @@ static void game_doCollectables()
 
                                        case P_PLASMA_DAMAGE:
                                                game.powerups++;
-                                               if ((game.area != MISN_INTERCEPTION) ||
-                                                       (game.difficulty == DIFFICULTY_ORIGINAL) ||
-                                                       (player.ammo[0] > 0))
+                                               if (game.difficulty == DIFFICULTY_ORIGINAL)
+                                               {
+                                                       player.ammo[0] = MAX(player.ammo[0], 50);
+                                                       weapon[W_PLAYER_WEAPON].damage = MIN(
+                                                               game.maxPlasmaDamage, weapon[W_PLAYER_WEAPON].damage + 1);
+                                               }
+                                               else if ((game.area != MISN_INTERCEPTION) ||
+                                                               (player.ammo[0] > 0))
                                                {
-                                                       if ((game.area != MISN_INTERCEPTION) ||
-                                                                       (game.difficulty == DIFFICULTY_ORIGINAL))
+                                                       if (game.area != MISN_INTERCEPTION)
                                                                LIMIT_ADD(player.ammo[0], collectable->value,
                                                                        0, game.maxPlasmaAmmo);
 
                                                        if (weapon[W_PLAYER_WEAPON].damage >= game.maxPlasmaDamage)
-                                                               sprintf(temp, "²ÐÎÏ ºÇÂç");
-                                                       else {
+                                                               sprintf(temp, "²ÐÎÏ ´û¤ËºÇÂç");
+                                                       else
+                                                       {
                                                                weapon[W_PLAYER_WEAPON].damage++;
                                                                sprintf(temp, "²ÐÎÏ Áý²Ã");
                                                        }
@@ -312,8 +383,9 @@ static void game_doCollectables()
                                                        (game.difficulty == DIFFICULTY_ORIGINAL) ||
                                                        (player.ammo[0] > 0))
                                                {
-                                                       if ((game.area != MISN_INTERCEPTION) ||
-                                                                       (game.difficulty == DIFFICULTY_ORIGINAL))
+                                                       if (game.difficulty == DIFFICULTY_ORIGINAL)
+                                                               player.ammo[0] = MAX(player.ammo[0], 50);
+                                                       else if (game.area != MISN_INTERCEPTION)
                                                                LIMIT_ADD(player.ammo[0], collectable->value,
                                                                        0, game.maxPlasmaAmmo);
 
@@ -332,7 +404,7 @@ static void game_doCollectables()
 
                                        case P_PLASMA_AMMO:
                                                if (player.ammo[0] >= game.maxPlasmaAmmo)
-                                                       sprintf(temp, "¥×¥é¥º¥Þ¥»¥ë ºÇÂç");
+                                                       sprintf(temp, "¥×¥é¥º¥Þ¥»¥ë ´û¤ËºÇÂç");
                                                else
                                                {
                                                        LIMIT_ADD(player.ammo[0], collectable->value,
@@ -378,9 +450,9 @@ static void game_doCollectables()
                                {
                                        setInfoLine(temp, FONT_WHITE);
                                        if (collectable->type == P_SHIELD)
-                                               audio_playSound(SFX_SHIELDUP, player.x);
+                                               audio_playSound(SFX_SHIELDUP, player.x, player.y);
                                        else
-                                               audio_playSound(SFX_PICKUP, player.x);
+                                               audio_playSound(SFX_PICKUP, player.x, player.y);
                                }
                        }
 
@@ -409,7 +481,9 @@ static void game_doCollectables()
                }
                else
                {
-                       if (collectable->type == P_MINE)
+                       if ((collectable->type == P_MINE) && (collectable->x >= 0) &&
+                                       (collectable->x <= screen->w) && (collectable->y >= 0) &&
+                                       (collectable->y <= screen->h))
                                collectable_explode(collectable);
                        prevCollectable->next = collectable->next;
                        delete collectable;
@@ -464,16 +538,16 @@ static void game_doBullets()
 
                        if (bullet->id == WT_ROCKET)
                        {
-                               explosion_add(bullet->x, bullet->y, E_SMALL_EXPLOSION);
+                               explosion_add(bullet->x, bullet->y, SP_SMALL_EXPLOSION);
                        }
                        else if (bullet->id == WT_MICROROCKET)
                        {
-                               explosion_add(bullet->x, bullet->y, E_TINY_EXPLOSION);
+                               explosion_add(bullet->x, bullet->y, SP_TINY_EXPLOSION);
                        }
 
                        if ((bullet->flags & WF_AIMED))
                        {
-                               blit(bullet->image[0], (int)(bullet->x - bullet->dx),
+                               screen_blit(bullet->image[0], (int)(bullet->x - bullet->dx),
                                        (int)(bullet->y - bullet->dy));
                        }
 
@@ -485,13 +559,13 @@ static void game_doBullets()
                                        charger_num = bullet->damage * 2;
 
                                for (int i = 0 ; i < charger_num ; i++)
-                                       blit(bullet->image[0],
+                                       screen_blit(bullet->image[0],
                                                (int)(bullet->x - RANDRANGE(
                                                        -(charger_num / 6), charger_num / 6)),
                                                (int)(bullet->y + RANDRANGE(-3, 3)));
                        }
 
-                       blit(bullet->image[0], (int)bullet->x, (int)bullet->y);
+                       screen_blit(bullet->image[0], (int)bullet->x, (int)bullet->y);
                        bullet->x += bullet->dx;
                        bullet->y += bullet->dy;
 
@@ -542,7 +616,7 @@ static void game_doBullets()
 
                                if (okayToHit)
                                {
-                                       if ((bullet->active) && (collision(bullet, &aliens[i])))
+                                       if ((bullet->active) && (bullet_collision(bullet, &aliens[i])))
                                        {
                                                old_shield = aliens[i].shield;
 
@@ -576,11 +650,11 @@ static void game_doBullets()
                                                        {
                                                                bullet->active = false;
                                                                bullet->shield = 0;
-                                                               audio_playSound(SFX_EXPLOSION, bullet->x);
+                                                               audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
                                                                for (int i = 0 ; i < 10 ; i++)
                                                                        explosion_add(bullet->x + RANDRANGE(-35, 35),
                                                                                bullet->y + RANDRANGE(-35, 35),
-                                                                               E_BIG_EXPLOSION);
+                                                                               SP_BIG_EXPLOSION);
                                                        }
                                                }
                                                else
@@ -590,9 +664,9 @@ static void game_doBullets()
                                                }
 
                                                if (bullet->id == WT_ROCKET)
-                                                       explosion_add(bullet->x, bullet->y, E_BIG_EXPLOSION);
+                                                       explosion_add(bullet->x, bullet->y, SP_BIG_EXPLOSION);
                                                else
-                                                       explosion_add(bullet->x, bullet->y, E_SMALL_EXPLOSION);
+                                                       explosion_add(bullet->x, bullet->y, SP_SMALL_EXPLOSION);
                                        }
                                }
                        }
@@ -602,11 +676,11 @@ static void game_doBullets()
                                (bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
                        {
                                if (bullet->active && (player.shield > 0) &&
-                                       (bullet->owner != &player) && collision(bullet, &player))
+                                       (bullet->owner != &player) && bullet_collision(bullet, &player))
                                {
                                        old_shield = player.shield;
 
-                                       if ((!engine.cheatShield) || (engine.missionCompleteTimer != 0))
+                                       if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0))
                                        {
                                                if ((player.shield > engine.lowShield) &&
                                                                (player.shield - bullet->damage <= engine.lowShield))
@@ -628,10 +702,10 @@ static void game_doBullets()
                                                {
                                                        bullet->active = false;
                                                        bullet->shield = 0;
-                                                       audio_playSound(SFX_EXPLOSION, bullet->x);
+                                                       audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
                                                        for (int i = 0 ; i < 10 ; i++)
                                                                explosion_add(bullet->x + RANDRANGE(-35, 35),
-                                                                       bullet->y + RANDRANGE(-35, 35), E_BIG_EXPLOSION);
+                                                                       bullet->y + RANDRANGE(-35, 35), SP_BIG_EXPLOSION);
                                                }
                                        }
                                        else
@@ -640,12 +714,12 @@ static void game_doBullets()
                                                bullet->shield = 0;
                                        }
 
-                                       audio_playSound(SFX_HIT, player.x);
+                                       audio_playSound(SFX_HIT, player.x, player.y);
 
                                        if (bullet->id == WT_ROCKET)
-                                               explosion_add(bullet->x, bullet->y, E_BIG_EXPLOSION);
+                                               explosion_add(bullet->x, bullet->y, SP_BIG_EXPLOSION);
                                        else
-                                               explosion_add(bullet->x, bullet->y, E_SMALL_EXPLOSION);
+                                               explosion_add(bullet->x, bullet->y, SP_SMALL_EXPLOSION);
                                }
                        }
                }
@@ -657,19 +731,19 @@ static void game_doBullets()
                        {
                                if (cargo[j].active)
                                {
-                                       if (collision(bullet, &cargo[j]))
+                                       if (bullet_collision(bullet, &cargo[j]))
                                        {
                                                bullet->active = false;
-                                               explosion_add(bullet->x, bullet->y, E_SMALL_EXPLOSION);
-                                               audio_playSound(SFX_HIT, cargo[j].x);
+                                               explosion_add(bullet->x, bullet->y, SP_SMALL_EXPLOSION);
+                                               audio_playSound(SFX_HIT, cargo[j].x, cargo[j].y);
                                                if (cargo[j].collectType != P_PHOEBE)
                                                {
                                                        cargo[j].active = false;
-                                                       audio_playSound(SFX_EXPLOSION, cargo[j].x);
+                                                       audio_playSound(SFX_EXPLOSION, cargo[j].x, cargo[j].y);
                                                        for (int i = 0 ; i < 10 ; i++)
                                                                explosion_add(cargo[j].x + RANDRANGE(-15, 15),
                                                                        cargo[j].y + RANDRANGE(-15, 15),
-                                                                       E_BIG_EXPLOSION);
+                                                                       SP_BIG_EXPLOSION);
                                                        updateMissionRequirements(M_PROTECT_PICKUP,
                                                                P_CARGO, 1);
                                                }
@@ -688,7 +762,7 @@ static void game_doBullets()
 
                        if (collectable->type == P_MINE)
                        {
-                               if (collision(collectable, bullet))
+                               if (collectable_collision(collectable, bullet))
                                {
                                        collectable->active = false;
                                        
@@ -731,10 +805,10 @@ static void game_doBullets()
                {
                        if (bullet->flags & WF_TIMEDEXPLOSION)
                        {
-                               audio_playSound(SFX_EXPLOSION, bullet->x);
+                               audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
                                for (int i = 0 ; i < 10 ; i++)
                                        explosion_add(bullet->x + RANDRANGE(-35, 35),
-                                               bullet->y + RANDRANGE(-35, 35), E_BIG_EXPLOSION);
+                                               bullet->y + RANDRANGE(-35, 35), SP_BIG_EXPLOSION);
 
                                player_checkShockDamage(bullet->x, bullet->y);
                        }
@@ -915,7 +989,7 @@ static void game_doAliens()
                                                aliens[i].flags -= FL_ISCLOAKED;
                                        else
                                                aliens[i].flags += FL_ISCLOAKED;
-                                       audio_playSound(SFX_CLOAK, aliens[i].x);
+                                       audio_playSound(SFX_CLOAK, aliens[i].x, aliens[i].y);
                                }
 
                                if (aliens[i].classDef == CD_BARRIER)
@@ -950,32 +1024,32 @@ static void game_doAliens()
 
                                if (canFire)
                                {
-                                       if ((aliens[i].reload[0] == 0) &&
-                                               ((rand() % 1000 < aliens[i].chance[0]) ||
-                                                       (aliens[i].flags & FL_CONTINUOUS_FIRE)))
+                                       for (int j = 0 ; j < 2 ; j++)
                                        {
-                                               ship_fireBullet(&aliens[i], 0);
-                                       }
-                                       if ((aliens[i].reload[1] == 0) &&
-                                               ((rand() % 1000 < aliens[i].chance[1]) ||
-                                                       (aliens[i].flags & FL_CONTINUOUS_FIRE)))
-                                       {
-                                               if ((aliens[i].weaponType[1] != W_ENERGYRAY) &&
-                                                       (aliens[i].weaponType[1] != W_LASER))
-                                               {
-                                                       if (aliens[i].weaponType[1] == W_CHARGER)
-                                                               aliens[i].ammo[1] = 50 + rand() % 150;
-                                                       ship_fireBullet(&aliens[i], 1);
-                                               }
-                                               else if (aliens[i].weaponType[1] == W_LASER)
-                                               {
-                                                       aliens[i].flags += FL_FIRELASER;
-                                               }
-                                               else if ((aliens[i].weaponType[1] == W_ENERGYRAY) &&
-                                                       (aliens[i].ammo[0] == 250))
+                                               if ((aliens[i].reload[j] == 0) &&
+                                                       ((rand() % 1000 < aliens[i].chance[j]) ||
+                                                               (aliens[i].flags & FL_CONTINUOUS_FIRE)))
                                                {
-                                                       aliens[i].flags += FL_FIRERAY;
-                                                       audio_playSound(SFX_ENERGYRAY, aliens[i].x);
+                                                       if ((aliens[i].weaponType[j] != W_ENERGYRAY) &&
+                                                               (aliens[i].weaponType[j] != W_LASER))
+                                                       {
+                                                               if (aliens[i].weaponType[j] == W_CHARGER)
+                                                                       aliens[i].ammo[j] = 50 + rand() % 150;
+                                                               ship_fireBullet(&aliens[i], j);
+                                                       }
+                                                       else if (aliens[i].weaponType[j] == W_LASER)
+                                                       {
+                                                               aliens[i].flags += FL_FIRELASER;
+                                                       }
+                                                       // XXX: This ammo check only seems to work for ammo[0],
+                                                       // not ammo[1], thus necessitating using ammo[0] instead of
+                                                       // ammo[j]. Should be investigated in the future.
+                                                       else if ((aliens[i].weaponType[j] == W_ENERGYRAY) &&
+                                                               (aliens[i].ammo[0] >= 250))
+                                                       {
+                                                               aliens[i].flags += FL_FIRERAY;
+                                                               audio_playSound(SFX_ENERGYRAY, aliens[i].x, aliens[i].y);
+                                                       }
                                                }
                                        }
                                }
@@ -1014,7 +1088,7 @@ static void game_doAliens()
                                shapeToUse = aliens[i].imageIndex[aliens[i].face];
 
                                if (aliens[i].hit)
-                                       shapeToUse += SHIP_HIT_INDEX;
+                                       shapeToUse += SS_HIT_INDEX;
 
                                LIMIT_ADD(aliens[i].hit, -1, 0, 100);
 
@@ -1028,14 +1102,14 @@ static void game_doAliens()
                                                        (aliens[i].classDef != CD_ASTEROID2))
                                                explosion_addEngine(&aliens[i]);
                                        if ((!(aliens[i].flags & FL_ISCLOAKED)) || (aliens[i].hit > 0))
-                                               blit(shipShape[shapeToUse], (int)aliens[i].x,
+                                               screen_blit(gfx_shipSprites[shapeToUse], (int)aliens[i].x,
                                                        (int)aliens[i].y);
                                        if (aliens[i].flags & FL_DISABLED)
                                        {
                                                if ((rand() % 10) == 0)
                                                        explosion_add(aliens[i].x + (rand() % aliens[i].image[0]->w),
                                                                aliens[i].y + (rand() % aliens[i].image[0]->h),
-                                                               E_ELECTRICAL);
+                                                               SP_ELECTRICAL);
                                        }
                                }
 
@@ -1048,11 +1122,11 @@ static void game_doAliens()
                                if ((aliens[i].x > 0) && (aliens[i].x < screen->w) &&
                                        (aliens[i].y > 0) && (aliens[i].y < screen->h))
                                {
-                                       blit(aliens[i].image[aliens[i].face], (int)aliens[i].x,
+                                       screen_blit(aliens[i].image[aliens[i].face], (int)aliens[i].x,
                                                (int)aliens[i].y);
                                        explosion_add(aliens[i].x + (rand() % aliens[i].image[0]->w),
                                                aliens[i].y + (rand() % aliens[i].image[0]->h),
-                                               E_BIG_EXPLOSION);
+                                               SP_BIG_EXPLOSION);
                                }
                                if (aliens[i].shield < aliens[i].deathCounter)
                                {
@@ -1234,7 +1308,7 @@ static void game_doPlayer()
                                if ((engine.done == 0) && (engine.gameSection == SECTION_GAME) &&
                                        (currentMission.remainingObjectives1 == 0))
                                {
-                                       audio_playSound(SFX_FLY, screen->w / 2);
+                                       audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
                                        engine.done = 2;
                                        engine.missionCompleteTimer = (SDL_GetTicks() - 1);
                                }
@@ -1246,8 +1320,7 @@ static void game_doPlayer()
                                engine.keyState[KEY_PAUSE] = 0;
                        }
 
-                       if (((game.area == MISN_ELLESH) &&
-                                       (aliens[ALIEN_BOSS].shield > 0)) ||
+                       if ((game.area == MISN_ELLESH) ||
                                (game.area == MISN_MARS))
                        {
                                player.face = 0;
@@ -1334,15 +1407,15 @@ static void game_doPlayer()
                        shapeToUse = player.face;
 
                        if (player.hit)
-                               shapeToUse += SHIP_HIT_INDEX;
+                               shapeToUse += SS_HIT_INDEX;
 
                        LIMIT_ADD(player.hit, -1, 0, 100);
 
-                       blit(shipShape[shapeToUse], (int)player.x, (int)player.y);
+                       screen_blit(gfx_shipSprites[shapeToUse], (int)player.x, (int)player.y);
                        if ((player.maxShield > 1) && (player.shield <= engine.lowShield) &&
                                        (rand() % 5 < 1))
                                explosion_add(player.x + RANDRANGE(-10, 10),
-                                       player.y + RANDRANGE(-10, 20), E_SMOKE);
+                                       player.y + RANDRANGE(-10, 20), SP_SMOKE);
                }
                else
                {
@@ -1360,14 +1433,14 @@ static void game_doPlayer()
                                                aliens[i].flags |= FL_LEAVESECTOR;
                                }
 
-                               audio_playSound(SFX_DEATH, player.x);
-                               audio_playSound(SFX_EXPLOSION, player.x);
+                               audio_playSound(SFX_DEATH, player.x, player.y);
+                               audio_playSound(SFX_EXPLOSION, player.x, player.y);
                        }
 
                        engine.keyState[KEY_UP] = engine.keyState[KEY_DOWN] = engine.keyState[KEY_LEFT] = engine.keyState[KEY_RIGHT] = 0;
-                       if ((rand() % 3) == 0)
+                       if (CHANCE(1. / 3.))
                                explosion_add(player.x + RANDRANGE(-10, 10),
-                                       player.y + RANDRANGE(-10, 10), E_BIG_EXPLOSION);
+                                       player.y + RANDRANGE(-10, 10), SP_BIG_EXPLOSION);
                        if (player.shield == -99)
                                game_addDebris((int)player.x, (int)player.y, player.maxShield);
                }
@@ -1377,14 +1450,8 @@ static void game_doPlayer()
        LIMIT(engine.ssy, -cameraMaxSpeed, cameraMaxSpeed);
 
        // Specific for the mission were you have to chase the Executive Transport
-       if ((game.area == MISN_ELLESH) && (aliens[ALIEN_BOSS].shield > 0) &&
-               (player.shield > 0))
-       {
-               engine.ssx = -6;
-               engine.ssy = 0;
-       }
-       
-       if (game.area == MISN_MARS)
+       if (((game.area == MISN_ELLESH) && (player.shield > 0)) ||
+                       (game.area == MISN_MARS))
        {
                engine.ssx = -6;
                engine.ssy = 0;
@@ -1408,7 +1475,7 @@ static void game_doCargo()
                                continue;
                        }
 
-                       blit(cargo[i].image[0], (int)cargo[i].x, (int)cargo[i].y);
+                       screen_blit(cargo[i].image[0], (int)cargo[i].x, (int)cargo[i].y);
 
                        cargo[i].x += engine.ssx + engine.smx;
                        cargo[i].y += engine.ssy + engine.smy;
@@ -1424,7 +1491,7 @@ static void game_doCargo()
                        // draw the chain link line
                        for (int j = 0 ; j < 10 ; j++)
                        {
-                               blit(shape[30], (int)chainX, (int)chainY);
+                               screen_blit(gfx_sprites[SP_CHAIN_LINK], (int)chainX, (int)chainY);
                                chainX -= dx;
                                chainY -= dy;
                        }
@@ -1451,7 +1518,7 @@ static void game_doDebris()
                        debris->x += debris->dx;
                        debris->y += debris->dy;
 
-                       explosion_add(debris->x + RANDRANGE(-10, 10), debris->y + RANDRANGE(-10, 10), E_BIG_EXPLOSION);
+                       explosion_add(debris->x + RANDRANGE(-10, 10), debris->y + RANDRANGE(-10, 10), SP_BIG_EXPLOSION);
                }
 
                if (debris->thinktime < 1)
@@ -1490,9 +1557,9 @@ void game_doExplosions()
                        explosion->x += engine.ssx + engine.smx;
                        explosion->y += engine.ssy + engine.smy;
 
-                       blit(explosion->image[0], (int)explosion->x, (int)explosion->y);
+                       screen_blit(explosion->image[0], (int)explosion->x, (int)explosion->y);
 
-                       if(rand() % 7 == 0)
+                       if(CHANCE(1. / 7.))
                        {
                                explosion->thinktime -= 7;
 
@@ -1503,7 +1570,7 @@ void game_doExplosions()
                                else
                                {
                                        explosion->face++;
-                                       explosion->image[0] = shape[explosion->face];
+                                       explosion->image[0] = gfx_sprites[explosion->face];
                                }
                        }
                }
@@ -1527,62 +1594,81 @@ Draw an arrow at the edge of the screen for each enemy ship that is not visible.
 */
 static void game_doArrow(int i)
 {
-       if (i < 0 || !aliens[i].active || aliens[i].shield <= 0 || aliens[i].flags & FL_ISCLOAKED)
-               return;
+       int arrow = -1;
+       int arrowX;
+       int arrowY;
 
-       int x = aliens[i].x + aliens[i].image[0]->w / 2;
-       int y = aliens[i].y + aliens[i].image[0]->h / 2;
+       int indicator = -1;
+       int indicatorX;
+       int indicatorY;
 
-       float sx = fabsf((x - (screen->w / 2)) / (screen->w / 2.0));
-       float sy = fabsf((y - (screen->h / 2)) / (screen->h / 2.0));
-       float sxy = MAX(sx, sy);
-
-       if (sxy < 1) 
+       if (i < 0 || !aliens[i].active || aliens[i].shield <= 0 || aliens[i].flags & FL_ISCLOAKED)
                return;
 
-       x = screen->w / 2 + (x - screen->w / 2) / sxy;
-       y = screen->h / 2 + (y - screen->h / 2) / sxy;
-
-       int arrow;
-
-       if (sxy == sx) {
-               arrow = x < screen->w / 2 ? 42 : 38;
-               x -= x > screen->w / 2 ? shape[arrow]->w : 0;
-               y -= shape[arrow]->h / 2;
-       } else {
-               arrow = y < screen->h / 2 ? 36 : 40;
-               x -= shape[arrow]->w / 2;
-               y -= y > screen->h / 2 ? shape[arrow]->h : 0;
+       if (aliens[i].x + aliens[i].image[0]->w < 0)
+       {
+               if (aliens[i].y + aliens[i].image[0]->h < 0)
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_NORTHWEST : SP_ARROW_NORTHWEST;
+               else if (aliens[i].y > screen->h)
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_SOUTHWEST : SP_ARROW_SOUTHWEST;
+               else
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_WEST : SP_ARROW_WEST;
        }
-
-       blit(shape[arrow], x, y);
-
-       if (i != engine.targetIndex)
-               return;
-
-       if (textShape[3].life > 0)
-               return;
-
-       if (sxy == sx) {
-               x -= x > screen->w / 2 ? 5 + shape[44]->w : -5 - shape[arrow]->w;
-               y -= (shape[44]->h - shape[arrow]->h) / 2;
-       } else {
-               x -= (shape[44]->w - shape[arrow]->w) / 2;
-               y -= y > screen->h / 2 ? 5 + shape[44]->h : -5 - shape[arrow]->h;
+       else if (aliens[i].x > screen->w)
+       {
+               if (aliens[i].y + aliens[i].image[0]->h < 0)
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_NORTHEAST : SP_ARROW_NORTHEAST;
+               else if (aliens[i].y > screen->h)
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_SOUTHEAST : SP_ARROW_SOUTHEAST;
+               else
+                       arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_EAST : SP_ARROW_EAST;
        }
+       else if (aliens[i].y + aliens[i].image[0]->h < 0)
+               arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_NORTH : SP_ARROW_NORTH;
+       else if (aliens[i].y > screen->h)
+               arrow = (aliens[i].flags & FL_FRIEND) ? SP_ARROW_FRIEND_SOUTH : SP_ARROW_SOUTH;
 
-       blit(shape[44], x, y);
+       if (arrow != -1)
+       {
+               arrowX = aliens[i].x + aliens[i].image[0]->w / 2 - gfx_sprites[arrow]->w;
+               arrowX = MAX(0, MIN(arrowX, screen->w - gfx_sprites[arrow]->w));
+               arrowY = aliens[i].y + aliens[i].image[0]->h / 2 - gfx_sprites[arrow]->h;
+               arrowY = MAX(0, MIN(arrowY, screen->h - gfx_sprites[arrow]->h));
+               screen_blit(gfx_sprites[arrow], arrowX, arrowY);
+
+               if (i == ALIEN_SID)
+                       indicator = SP_INDICATOR_SID;
+               else if (i == ALIEN_PHOEBE)
+                       indicator = SP_INDICATOR_PHOEBE;
+               else if (i == ALIEN_URSULA)
+                       indicator = SP_INDICATOR_URSULA;
+               else if (i == ALIEN_KLINE)
+                       indicator = SP_INDICATOR_KLINE;
+               else if (i == engine.targetIndex)
+                       indicator = SP_INDICATOR_TARGET;
+
+               if (indicator != -1)
+               {
+                       indicatorX = arrowX + gfx_sprites[arrow]->w / 2 - gfx_sprites[indicator]->w / 2;
+                       indicatorX = MAX(indicatorX, gfx_sprites[arrow]->w + 5);
+                       indicatorX = MIN(indicatorX, screen->w - gfx_sprites[arrow]->w - gfx_sprites[indicator]->w - 5);
+                       indicatorY = arrowY + gfx_sprites[arrow]->h / 2 - gfx_sprites[indicator]->h / 2;
+                       indicatorY = MAX(indicatorY, gfx_sprites[arrow]->h + 5);
+                       indicatorY = MIN(indicatorY, screen->h - gfx_sprites[arrow]->h - gfx_sprites[indicator]->h - 5);
+                       screen_blit(gfx_sprites[indicator], indicatorX, indicatorY);
+               }
+       }
 }
 
 static void game_doHud()
 {
        int shieldColor = 0;
        SDL_Rect bar;
-       signed char fontColor;
+       int fontColor;
        char text[25];
 
-       addBuffer(0, 20, 800, 25);
-       addBuffer(0, 550, 800, 34);
+       screen_addBuffer(0, 20, screen->w, 25);
+       screen_addBuffer(0, screen->h - 50, screen->w, 34);
 
        if (engine.minutes > -1)
        {
@@ -1592,24 +1678,24 @@ static void game_doHud()
                        fontColor = FONT_YELLOW;
                else
                        fontColor = FONT_WHITE;
-               blitText(10); // time remaining
+               screen_blitText(TS_TIME_T);
                sprintf(text, "%.2d:%.2d", engine.minutes, engine.seconds);
-               textSurface(30, text, 410, 21, fontColor);
-               blitText(30);
+               gfx_createTextObject(TS_TIME, text, screen->w / 2 + 10, 21, fontColor);
+               screen_blitText(TS_TIME);
        }
 
        if (game.area != MISN_INTERCEPTION)
        {
-               blitText(9); // mission objectives
+               screen_blitText(TS_OBJECTIVES_T);
                sprintf(text, "%d", (currentMission.remainingObjectives1 + currentMission.remainingObjectives2));
-               textSurface(39, text, 745, 21, FONT_WHITE);
-               blitText(39);
+               gfx_createTextObject(TS_OBJECTIVES, text, screen->w - 55, 21, FONT_WHITE);
+               screen_blitText(TS_OBJECTIVES);
        }
 
-       blitText(8); // cash
+       screen_blitText(TS_CASH_T); // cash
        sprintf(text, "%.6d", game.cash);
-       textSurface(38, text, 90, 21, FONT_WHITE);
-       blitText(38);
+       gfx_createTextObject(TS_CASH, text, 90, 21, FONT_WHITE);
+       screen_blitText(TS_CASH);
 
        for (int i = 0; i < ALIEN_MAX; i++)
                game_doArrow(i);
@@ -1620,12 +1706,12 @@ static void game_doHud()
                if (player.ammo[0] <= 25) fontColor = FONT_YELLOW;
                if (player.ammo[0] <= 10) fontColor = FONT_RED;
        }
-       blitText(5); // plasma ammo
+       screen_blitText(TS_PLASMA_T);
        sprintf(text, "%.3d", player.ammo[0]);
-       textSurface(35, text, 320, 551, fontColor);
-       blitText(35);
+       gfx_createTextObject(TS_PLASMA, text, screen->w * 5 / 16 + 70, screen->h - 49, fontColor);
+       screen_blitText(TS_PLASMA);
 
-       blitText(6);
+       screen_blitText(TS_AMMO_T);
 
        if ((player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_LASER))
        {
@@ -1634,8 +1720,8 @@ static void game_doHud()
                else
                        fontColor = FONT_WHITE;
                sprintf(text, "%.3d", player.ammo[1]); // rocket ammo
-               textSurface(36, text, 465, 551, fontColor);
-               blitText(36);
+               gfx_createTextObject(TS_AMMO, text, screen->w / 2 + 80, screen->h - 49, fontColor);
+               screen_blitText(TS_AMMO);
        }
 
        if (((player.weaponType[1] == W_CHARGER) || (player.weaponType[1] == W_LASER)) && (player.ammo[1] > 0))
@@ -1644,15 +1730,15 @@ static void game_doHud()
                if (player.ammo[1] > 100)
                        c = red;
 
-               bar.x = 450;
-               bar.y = 550;
+               bar.x = screen->w / 2 + 65;
+               bar.y = screen->h - 50;
                bar.h = 12;
 
                for (int i = 0 ; i < (player.ammo[1] / 5) ; i++)
                {
-                       bar.w = 1;
+                       bar.w = MAX(screen->w / 800, 1);
                        SDL_FillRect(screen, &bar, c);
-                       bar.x += 2;
+                       bar.x += bar.w + (screen->w / 800);
                }
        }
 
@@ -1661,7 +1747,7 @@ static void game_doHud()
                engine.timeTaken++;
                engine.counter2 = SDL_GetTicks() + 1000;
                if (engine.missionCompleteTimer == 0)
-                       checkScriptEvents();
+                       events_check();
        }
 
        if ((engine.timeMission) && (!engine.cheatTime) && (player.shield > 0))
@@ -1670,7 +1756,7 @@ static void game_doHud()
                {
                        if ((engine.seconds > 1) && (engine.seconds <= 11) && (engine.minutes == 0))
                        {
-                               audio_playSound(SFX_CLOCK, screen->w / 2);
+                               audio_playSound(SFX_CLOCK, screen->w / 2, screen->h / 2);
                        }
 
                        if (engine.seconds > 0)
@@ -1691,7 +1777,7 @@ static void game_doHud()
                                                currentMission.timeLimit2[i]--;
                                }
                                checkTimer();
-                               checkScriptEvents();
+                               events_check();
                        }
 
                        if ((engine.seconds == 0) && (engine.minutes == 0))
@@ -1704,67 +1790,79 @@ static void game_doHud()
                                                currentMission.timeLimit2[i]--;
                                }
                                checkTimer();
-                               checkScriptEvents();
+                               events_check();
                                engine.counter = (SDL_GetTicks() + 1000);
                        }
                }
        }
 
-       for (int i = 0 ; i < 3 ; i++)
+       for (int i = 0 ; i < MAX_INFOLINES ; i++)
        {
-               if (textShape[i].life > 0)
+               if (gfx_textSprites[i].life > 0)
                {
-                       textShape[i].y = (525 - (i * 20));
-                       blitText(i);
-                       textShape[i].life--;
+                       gfx_textSprites[i].y = screen->h - 75 - (i * 20);
+                       screen_blitText(i);
+                       gfx_textSprites[i].life--;
 
-                       if (textShape[i].life == 0)
+                       if (gfx_textSprites[i].life == 0)
                        {
-                               copyInfoLine(i + 1, i);
-                               copyInfoLine(i + 2, i + 1);
-                               textShape[2].life = 0;
+                               for (int j = i ; j < MAX_INFOLINES - 1 ; j++)
+                               {
+                                       copyInfoLine(j + 1, j);
+                               }
+                               gfx_textSprites[MAX_INFOLINES - 1].life = 0;
                        }
                }
        }
 
        // Show the radio message if there is one
-       if (textShape[3].life > 0)
+       if (gfx_textSprites[TS_RADIO].life > 0)
        {
-               blit(messageBox, (800 - messageBox->w) / 2, 50);
-               textShape[3].life--;
+               screen_blit(gfx_messageBox, (screen->w - gfx_messageBox->w) / 2, 50);
+               gfx_textSprites[TS_RADIO].life--;
        }
 
        // Do the target's remaining shield (if required)
        if (game.area != MISN_DORIM)
        {
-               if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) && (engine.targetIndex > 9))
+               if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) &&
+                               (engine.targetIndex > engine.maxAliens))
                {
-                       blitText(7);
-                       bar.w = 1;
+                       if (engine.targetIndex == ALIEN_SID)
+                               screen_blitText(TS_TARGET_SID);
+                       else if (engine.targetIndex == ALIEN_PHOEBE)
+                               screen_blitText(TS_TARGET_PHOEBE);
+                       else if (engine.targetIndex == ALIEN_KLINE)
+                               screen_blitText(TS_TARGET_KLINE);
+                       else
+                               screen_blitText(TS_TARGET);
+
+                       bar.w = MAX(screen->w / 800, 1);
                        bar.h = 12;
-                       bar.x = 620;
-                       bar.y = 550;
+                       bar.x = screen->w * 11 / 16 + 65;
+                       bar.y = screen->h - 50;
 
                        for (float i = 0 ; i < (engine.targetShield * aliens[engine.targetIndex].shield) ; i++)
                        {
-                               if (i > 50)
+                               if (i > engine.targetShield * aliens[engine.targetIndex].maxShield * 2 / 3)
                                        shieldColor = green;
-                               else if ((i >= 25) && (i <= 50))
+                               else if ((i >= engine.targetShield * aliens[engine.targetIndex].maxShield / 3) &&
+                                               (i <= engine.targetShield * aliens[engine.targetIndex].maxShield * 2 / 3))
                                        shieldColor = yellow;
                                else
                                        shieldColor = red;
                                SDL_FillRect(screen, &bar, shieldColor);
-                               bar.x += 2;
+                               bar.x += bar.w + (screen->w / 800);
                        }
                }
        }
 
-       blitText(11);
+       screen_blitText(TS_POWER);
 
-       bar.w = 25;
+       bar.w = screen->w / 32;
        bar.h = 12;
-       bar.x = 80;
-       bar.y = 571;
+       bar.x = screen->w / 32 + 55;
+       bar.y = screen->h - 29;
 
        for (int i = 1 ; i <= 5 ; i++)
        {
@@ -1775,15 +1873,15 @@ static void game_doHud()
                        }
                } else if (i <= game.maxPlasmaDamage)
                        SDL_FillRect(screen, &bar, darkGreen);
-               bar.x += 30;
+               bar.x += screen->w * 3 / 80;
        }
 
-       blitText(12);
+       screen_blitText(TS_OUTPUT);
 
-       bar.w = 25;
+       bar.w = screen->w / 32;
        bar.h = 12;
-       bar.x = 315;
-       bar.y = 571;
+       bar.x = screen->w * 5 / 16 + 65;
+       bar.y = screen->h - 29;
        SDL_FillRect(screen, &bar, yellow);
 
        for (int i = 1 ; i <= 5 ; i++)
@@ -1796,15 +1894,15 @@ static void game_doHud()
                }
                else if (i <= game.maxPlasmaOutput)
                        SDL_FillRect(screen, &bar, darkYellow);
-               bar.x += 30;
+               bar.x += screen->w * 3 / 80;
        }
 
-       blitText(13);
+       screen_blitText(TS_COOLER);
 
-       bar.w = 25;
+       bar.w = screen->w / 32;
        bar.h = 12;
-       bar.x = 550;
-       bar.y = 571;
+       bar.x = screen->w * 97 / 160 + 65;
+       bar.y = screen->h - 29;
 
        for (int i = 1 ; i <= 5 ; i++)
        {
@@ -1816,10 +1914,10 @@ static void game_doHud()
                }
                else if (i <= game.maxPlasmaRate)
                        SDL_FillRect(screen, &bar, darkerBlue);
-               bar.x += 30;
+               bar.x += screen->w * 3 / 80;
        }
 
-       blitText(4);
+       screen_blitText(TS_SHIELD);
        if (player.shield < 1)
                return;
 
@@ -1829,12 +1927,12 @@ static void game_doHud()
        if ((engine.eventTimer < 30) && (player.shield <= engine.lowShield))
                return;
 
-       signed char blockSize = 1;
+       int blockSize = MAX(screen->w / 800, 1);
 
        bar.w = blockSize;
        bar.h = 12;
-       bar.x = 95;
-       bar.y = 550;
+       bar.x = screen->w / 32 + 65;
+       bar.y = screen->h - 50;
 
        for (int i = 0 ; i < player.shield ; i += blockSize)
        {
@@ -1846,9 +1944,31 @@ static void game_doHud()
                        shieldColor = red;
                SDL_FillRect(screen, &bar, shieldColor);
                bar.x += blockSize;
-               if (player.maxShield < 75)
-                       bar.x++;
+               if (player.maxShield <= 75 || screen->w >= 1200)
+                       bar.x += screen->w / 800;
+       }
+}
+
+/*
+ * Delay until the next 60 Hz frame
+ */
+void game_delayFrame()
+{
+       Uint32 now = SDL_GetTicks();
+
+       // Add 16 2/3 (= 1000 / 60) to frameLimit
+       frameLimit += 16;
+       thirds += 2;
+       while (thirds >= 3)
+       {
+               thirds -= 3;
+               frameLimit++;
        }
+
+       if(now < frameLimit)
+               SDL_Delay(frameLimit - now);
+       else
+               frameLimit = now;
 }
 
 /*
@@ -1877,6 +1997,17 @@ static bool game_checkPauseRequest()
        return false;
 }
 
+bool game_collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1)
+{
+       float x1 = x0 + w0;
+       float y1 = y0 + h0;
+
+       float x3 = x2 + w1;
+       float y3 = y2 + h1;
+
+       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
+}
+
 int game_mainLoop()
 {
        resetLists();
@@ -1934,7 +2065,7 @@ int game_mainLoop()
        // Some specifics for interception missions
        if (game.area == MISN_INTERCEPTION)
        {
-               if ((game.system > 1) && ((rand() % 5) == 0))
+               if ((game.system > SYSTEM_EYANANTH) && ((rand() % 5) == 0))
                {
                        aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
                        aliens[ALIEN_KLINE].owner = &aliens[ALIEN_KLINE];
@@ -1945,19 +2076,19 @@ int game_mainLoop()
                        player_setTarget(ALIEN_KLINE);
                }
 
-               if ((game.system == 2) && (game.experimentalShield > 0))
+               if ((game.system == SYSTEM_MORDOR) && (game.experimentalShield > 0))
                {
                        if ((rand() % 5) > 0)
                        {
-                               aliens[10] = alien_defs[CD_CLOAKFIGHTER];
-                               aliens[10].owner = &aliens[10];
-                               aliens[10].target = &aliens[10];
-                               aliens[10].shield = 1000;
-                               aliens[10].active = true;
-                               aliens[10].x = player.x - 1000;
-                               aliens[10].y = player.y;
-                               player_setTarget(10);
-                               aliens[10].shield = game.experimentalShield;
+                               aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
+                               aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
+                               aliens[ALIEN_BOSS].target = &aliens[ALIEN_BOSS];
+                               aliens[ALIEN_BOSS].shield = 1000;
+                               aliens[ALIEN_BOSS].active = true;
+                               aliens[ALIEN_BOSS].x = player.x - 1000;
+                               aliens[ALIEN_BOSS].y = player.y;
+                               player_setTarget(ALIEN_BOSS);
+                               aliens[ALIEN_BOSS].shield = game.experimentalShield;
                        }
                }
        }
@@ -1982,7 +2113,6 @@ int game_mainLoop()
                case MISN_ELAMALE:
                case MISN_ODEON:
                case MISN_FELLON:
-               case MISN_POSWIC:
                case MISN_ELLESH:
                case MISN_PLUTO:
                case MISN_NEPTUNE:
@@ -1994,9 +2124,10 @@ int game_mainLoop()
                        player_setTarget(ALIEN_PHOEBE);
                        break;
                case MISN_ALLEZ:
-                       player_setTarget(ALIEN_GOODTRANSPORT);
+                       player_setTarget(ALIEN_FRIEND1);
                        break;
                case MISN_URUSOR:
+               case MISN_POSWIC:
                        player_setTarget(ALIEN_SID);
                        break;
                case MISN_EARTH:
@@ -2007,7 +2138,7 @@ int game_mainLoop()
 
        clearInfoLines();
 
-       loadScriptEvents();
+       events_init();
 
        engine.ssx = 0;
        engine.ssy = 0;
@@ -2044,8 +2175,8 @@ int game_mainLoop()
                }
        }
 
-       drawBackGround();
-       flushBuffer();
+       screen_drawBackground();
+       screen_flushBuffer();
 
        // Default to no aliens dead...
        engine.allAliensDead = 0;
@@ -2056,7 +2187,7 @@ int game_mainLoop()
 
        while (engine.done != 1)
        {
-               updateScreen();
+               renderer_update();
 
                if ((allMissionsCompleted()) && (engine.missionCompleteTimer == 0))
                {
@@ -2145,8 +2276,8 @@ int game_mainLoop()
                        getPlayerInput();
                }
 
-               unBuffer();
-               doStarfield();
+               screen_unBuffer();
+               game_doStars();
                game_doCollectables();
                game_doBullets();
                game_doAliens();
@@ -2160,15 +2291,15 @@ int game_mainLoop()
 
                if (engine.paused)
                {
-                       textSurface(22, "PAUSED", -1, screen->h / 2, FONT_WHITE);
-                       blitText(22);
-                       updateScreen();
+                       gfx_createTextObject(TS_PAUSED, "PAUSED", -1, screen->h / 2, FONT_WHITE);
+                       screen_blitText(TS_PAUSED);
+                       renderer_update();
                        audio_pauseMusic();
 
                        while (engine.paused)
                        {
                                engine.done = game_checkPauseRequest();
-                               delayFrame();
+                               game_delayFrame();
                        }
 
                        audio_resumeMusic();
@@ -2204,23 +2335,23 @@ int game_mainLoop()
                if ((game.area == MISN_MOEBO) &&
                        (aliens[ALIEN_BOSS].flags & FL_ESCAPED))
                {
-                       audio_playSound(SFX_DEATH, aliens[ALIEN_BOSS].x);
-                       clearScreen(white);
-                       updateScreen();
+                       audio_playSound(SFX_DEATH, aliens[ALIEN_BOSS].x, aliens[ALIEN_BOSS].y);
+                       screen_clear(white);
+                       renderer_update();
                        for (int i = 0 ; i < 300 ; i++)
                        {
                                SDL_Delay(10);
                                if ((rand() % 25) == 0)
-                                       audio_playSound(SFX_EXPLOSION, aliens[ALIEN_BOSS].x);
+                                       audio_playSound(SFX_EXPLOSION, aliens[ALIEN_BOSS].x, aliens[ALIEN_BOSS].y);
                        }
                        SDL_Delay(1000);
                        break;
                }
 
-               delayFrame();
+               game_delayFrame();
        }
 
-       flushBuffer();
+       screen_flushBuffer();
 
        if ((player.shield > 0) && (!missionFailed()))
        {
@@ -2230,20 +2361,20 @@ int game_mainLoop()
                switch (game.area)
                {
                        case MISN_MOEBO:
-                               doCutscene(1);
-                               doCutscene(2);
+                               cutscene_init(1);
+                               cutscene_init(2);
                                break;
                        case MISN_NEROD:
-                               doCutscene(3);
+                               cutscene_init(3);
                                break;
                        case MISN_ELAMALE:
-                               doCutscene(4);
+                               cutscene_init(4);
                                break;
                        case MISN_ODEON:
-                               doCutscene(5);
+                               cutscene_init(5);
                                break;
                        case MISN_ELLESH:
-                               doCutscene(6);
+                               cutscene_init(6);
                                break;
                        case MISN_VENUS:
                                doCredits();
index 0e05f46..db3d4e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -23,7 +23,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern Game game;
 
 void game_init();
+void game_doStars();
 void game_doExplosions();
+void game_delayFrame();
+bool game_collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1);
 int game_mainLoop();
 
 #endif
diff --git a/src/gfx.cpp b/src/gfx.cpp
new file mode 100644 (file)
index 0000000..d163e98
--- /dev/null
@@ -0,0 +1,549 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <ctype.h>
+
+#include "Starfighter.h"
+
+SDL_Surface *gfx_background;
+SDL_Surface *gfx_sprites[SP_MAX];
+SDL_Surface *gfx_faceSprites[FS_MAX];
+SDL_Surface *gfx_shipSprites[SS_MAX];
+SDL_Surface *gfx_fontSprites[FONT_MAX];
+SDL_Surface *gfx_shopSprites[SHOP_S_MAX];
+textObject gfx_textSprites[TS_MAX];
+SDL_Surface *gfx_messageBox;
+
+void gfx_init()
+{
+       screen_bufferHead = new bRect;
+       screen_bufferHead->next = NULL;
+       screen_bufferTail = screen_bufferHead;
+
+       for (int i = 0 ; i < SP_MAX ; i++)
+               gfx_sprites[i] = NULL;
+
+       for (int i = 0 ; i < SS_MAX ; i++)
+               gfx_shipSprites[i] = NULL;
+
+       for (int i = 0 ; i < TS_MAX ; i++)
+               gfx_textSprites[i].image = NULL;
+
+       for (int i = 0 ; i < SHOP_S_MAX ; i++)
+               gfx_shopSprites[i] = NULL;
+
+       for (int i = 0 ; i < FONT_MAX ; i++)
+               gfx_fontSprites[i] = NULL;
+
+       gfx_background = NULL;
+       gfx_messageBox = NULL;
+
+       screen = NULL;
+}
+
+SDL_Surface *gfx_setTransparent(SDL_Surface *sprite)
+{
+       SDL_SetColorKey(sprite, SDL_TRUE, SDL_MapRGB(sprite->format, 0, 0, 0));
+       return sprite;
+}
+
+void gfx_blit(SDL_Surface *image, int x, int y, SDL_Surface *dest)
+{
+       SDL_Rect blitRect;
+
+       // Exit early if image is not on dest at all
+       if (x + image->w < 0 || x >= dest->w || y + image->h < 0 || y >= dest->h)
+               return;
+
+       // Set up a rectangle to draw to
+       blitRect.x = x;
+       blitRect.y = y;
+       blitRect.w = image->w;
+       blitRect.h = image->h;
+
+       /* Blit onto the destination surface */
+       if (SDL_BlitSurface(image, NULL, dest, &blitRect) < 0)
+       {
+               printf("BlitSurface error: %s\n", SDL_GetError());
+               engine_showError(2, "");
+       }
+
+       // Only if it is to the screen, mark the region as damaged
+       if (dest == screen)
+               screen_addBuffer(blitRect.x, blitRect.y, blitRect.w, blitRect.h);
+}
+
+/*
+In 16 bit mode this is slow. VERY slow. Don't write directly to a surface
+that constantly needs updating (eg - the main game screen)
+*/
+static int gfx_renderStringBase(const char *in, int x, int y, int fontColor, int wrap, SDL_Surface *dest)
+{
+       int i;
+       int splitword;
+       SDL_Rect area;
+       SDL_Rect letter;
+
+       area.x = x;
+       area.y = y;
+       area.w = 8;
+       area.h = 14;
+
+       letter.y = 0;
+       letter.w = 8;
+       letter.h = 14;
+
+       while (*in != '\0')
+       {
+               if (*in & 0x80)
+               {
+                       if ((unsigned char )in[0] != 0x8e)
+                       {
+                               SDL_Rect kanji;
+
+                               kanji.x = ((in[1] & 0x7f) - 0x21) * 16;
+                               kanji.y = ((in[0] & 0x7f) - 0x21) * 16 + 16;
+                               kanji.w = 16;
+                               kanji.h = 16;
+
+                               area.y -= 1;
+                               if (SDL_BlitSurface(gfx_fontSprites[fontColor], &kanji, dest, &area) < 0)
+                               {
+                                       printf("BlitSurface error: %s\n", SDL_GetError());
+                                       engine_showError(2, "");
+                               }
+                               area.y += 1;
+                               area.x += 16;
+                       }
+                       else
+                       {
+                               SDL_Rect kana;
+
+                               kana.x = (int )((unsigned char )in[1] - 66) * 8;
+                               kana.y = 0;
+                               kana.w = 8;
+                               kana.h = 14;
+
+                               if (SDL_BlitSurface(gfx_fontSprites[fontColor], &kana, dest, &area) < 0)
+                               {
+                                       printf("BlitSurface error: %s\n", SDL_GetError());
+                                       engine_showError(2, "");
+                               }
+
+                               area.x += 8;
+                       }
+
+                       if (wrap)
+                       {
+                               if (area.x > (dest->w - 70))
+                               {
+                                       area.y += 16;
+                                       area.x = x;
+                               }
+                       }
+
+                       in += 2;
+               }
+               else
+               {
+                       if (*in != ' ')
+                       {
+                               letter.x = (*in - 33);
+                               letter.x *= 8;
+
+                               /* Blit onto the screen surface */
+                               if (SDL_BlitSurface(gfx_fontSprites[fontColor], &letter, dest, &area) < 0)
+                               {
+                                       printf("BlitSurface error: %s\n", SDL_GetError());
+                                       engine_showError(2, "");
+                               }
+                       }
+
+                       area.x += 9;
+
+                       if (wrap)
+                       {
+                               if ((area.x > (dest->w - 70)) && (*in == ' '))
+                               {
+                                       area.y += 16;
+                                       area.x = x;
+                               }
+                               else if (area.x > (dest->w - 31))
+                               {
+                                       splitword = 1;
+                                       for (i = 0 ; i < 4 ; i++)
+                                       {
+                                               if (!isalpha(*(in + i)))
+                                               {
+                                                       splitword = 0;
+                                                       break;
+                                               }
+                                       }
+
+                                       if (splitword)
+                                       {
+                                               letter.x = (int)('-') - 33;
+                                               letter.x *= 8;
+                                               if (SDL_BlitSurface(gfx_fontSprites[fontColor], &letter, dest, &area) < 0)
+                                               {
+                                                       printf("BlitSurface error: %s\n", SDL_GetError());
+                                                       engine_showError(2, "");
+                                               }
+                                               area.y += 16;
+                                               area.x = x;
+                                       }
+                               }
+                       }
+
+                       in++;
+               }
+       }
+
+       return area.y;
+}
+
+int gfx_renderString(const char *in, int x, int y, int fontColor, int wrap, SDL_Surface *dest)
+{
+       if (x == -1)
+               x = (dest->w - (strlen(in) * 9)) / 2;
+
+       gfx_renderStringBase(in, x, y - 1, FONT_OUTLINE, wrap, dest);
+       gfx_renderStringBase(in, x, y + 1, FONT_OUTLINE, wrap, dest);
+       gfx_renderStringBase(in, x, y + 2, FONT_OUTLINE, wrap, dest);
+       gfx_renderStringBase(in, x - 1, y, FONT_OUTLINE, wrap, dest);
+       gfx_renderStringBase(in, x - 2, y, FONT_OUTLINE, wrap, dest);
+       gfx_renderStringBase(in, x + 1, y, FONT_OUTLINE, wrap, dest);
+       return gfx_renderStringBase(in, x, y, fontColor, wrap, dest);
+}
+
+/*
+ * Set the pixel at (x, y) to the given value
+ * NOTE: The surface must be locked before calling this!
+ */
+void gfx_putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
+{
+       int bpp = surface->format->BytesPerPixel;
+       /* Here p is the address to the pixel we want to set */
+       Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+
+       switch(bpp)
+       {
+               case 1:
+                       *p = pixel;
+                       break;
+
+               case 2:
+                       *(Uint16 *)p = pixel;
+                       break;
+
+               case 3:
+                       if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+                       {
+                               p[0] = (pixel >> 16) & 0xff;
+                               p[1] = (pixel >> 8) & 0xff;
+                               p[2] = pixel & 0xff;
+                       }
+                       else
+                       {
+                               p[0] = pixel & 0xff;
+                               p[1] = (pixel >> 8) & 0xff;
+                               p[2] = (pixel >> 16) & 0xff;
+                       }
+                       break;
+
+                case 4:
+                       *(Uint32 *)p = pixel;
+                       break;
+       }
+}
+
+void gfx_drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col)
+{
+       int counter = 0;
+
+       if ( SDL_MUSTLOCK(dest) )
+       {
+               if ( SDL_LockSurface(dest) < 0 )
+               {
+                       printf("Can't lock screen: %s\n", SDL_GetError());
+                       engine_showError(2, "");
+               }
+       }
+
+       while(1)
+       {
+               gfx_putPixel(dest, x1, y1, col);
+
+               if (x1 > x2) x1--;
+               if (x1 < x2) x1++;
+               if (y1 > y2) y1--;
+               if (y1 < y2) y1++;
+
+               if ((x1 == x2) && (y1 == y2))
+                       {break;}
+               if (counter == 1000)
+                       {printf("Loop Error!\n"); break;}
+               counter++;
+       }
+
+       if (SDL_MUSTLOCK(dest))
+       {
+               SDL_UnlockSurface(dest);
+       }
+}
+
+/*
+A quick(?) circle draw function. This code was posted to the SDL
+mailing list... I didn't write it myself.
+*/
+void gfx_drawCircle(int xc, int yc, int R, SDL_Surface *PIX, int col)
+{
+       int x = 0;
+       int xx = 0;
+       int y = R;
+       int yy = 2 * R;
+       int p = 1 - R;
+
+       gfx_putPixel(PIX, xc, yc - y, col);
+       gfx_putPixel(PIX, xc, yc + y, col);
+       gfx_putPixel(PIX, xc - y, yc, col);
+       gfx_putPixel(PIX, xc + y, yc, col);
+
+       while (x < y)
+       {
+               xx += 2;
+               x++;
+               if (p >= 0)
+               {
+                       yy -= 2;
+                       y--;
+                       p -= yy;
+               }
+               p += xx + 1;
+
+               gfx_putPixel(PIX, xc - x, yc - y, col);
+               gfx_putPixel(PIX, xc + x, yc - y, col);
+               gfx_putPixel(PIX, xc - x, yc + y, col);
+               gfx_putPixel(PIX, xc + x, yc + y, col);
+               gfx_putPixel(PIX, xc - y, yc - x, col);
+               gfx_putPixel(PIX, xc + y, yc - x, col);
+               gfx_putPixel(PIX, xc - y, yc + x, col);
+               gfx_putPixel(PIX, xc + y, yc + x, col);
+       }
+
+       if ((x = y))
+       {
+               gfx_putPixel(PIX, xc - x, yc - y, col);
+               gfx_putPixel(PIX, xc + x, yc - y, col);
+               gfx_putPixel(PIX, xc - x, yc + y, col);
+               gfx_putPixel(PIX, xc + x, yc + y, col);
+       }
+}
+
+void gfx_drawRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue)
+{
+       SDL_Rect r = {(int16_t)x, (int16_t)y, (uint16_t)w, (uint16_t)h};
+       SDL_FillRect(dest, &r, SDL_MapRGB(screen->format, red, green, blue));
+
+       gfx_drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255));
+       gfx_drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255));
+       gfx_drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128));
+       gfx_drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128));
+}
+
+SDL_Surface *gfx_createSurface(int width, int height)
+{
+       SDL_Surface *surface;
+       Uint32 rmask, gmask, bmask, amask;
+
+       /* SDL interprets each pixel as a 32-bit number, so our masks must depend
+       on the endianness (byte order) of the machine */
+       #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+               rmask = 0xff000000;
+               gmask = 0x00ff0000;
+               bmask = 0x0000ff00;
+               amask = 0x000000ff;
+       #else
+               rmask = 0x000000ff;
+               gmask = 0x0000ff00;
+               bmask = 0x00ff0000;
+               amask = 0xff000000;
+       #endif
+
+       surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, rmask, gmask, bmask, amask);
+
+       if (surface == NULL) {
+               printf("CreateRGBSurface failed: %s\n", SDL_GetError());
+               engine_showError(2, "");
+       }
+
+       return surface;
+}
+
+SDL_Surface *gfx_createTextSurface(const char *inString, int color)
+{
+       // XXX: Magic numbers
+       SDL_Surface *surface = gfx_createSurface(strlen(inString) * 9, 16);
+
+       gfx_renderString(inString, 1, 1, color, 0, surface);
+
+       return gfx_setTransparent(surface);
+}
+
+void gfx_createTextObject(int index, const char *inString, int x, int y, int fontColor)
+{
+       /* Shortcut: if we already rendered the same string in the same color, don't render it again. */
+       if(gfx_textSprites[index].text && gfx_textSprites[index].image && gfx_textSprites[index].fontColor == fontColor && !strcmp(gfx_textSprites[index].text, inString)) {
+               gfx_textSprites[index].x = x;
+               gfx_textSprites[index].y = y;
+               if (x == -1)
+                       gfx_textSprites[index].x = (screen->w - gfx_textSprites[index].image->w) / 2;
+               return;
+       }
+
+       strcpy(gfx_textSprites[index].text, inString);
+       gfx_textSprites[index].x = x;
+       gfx_textSprites[index].y = y;
+       gfx_textSprites[index].fontColor = fontColor;
+       if (gfx_textSprites[index].image != NULL)
+       {
+               SDL_FreeSurface(gfx_textSprites[index].image);
+       }
+       gfx_textSprites[index].image = gfx_createTextSurface(inString, fontColor);
+       if (x == -1)
+               gfx_textSprites[index].x = (screen->w - gfx_textSprites[index].image->w) / 2;
+}
+
+SDL_Surface *gfx_createAlphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue)
+{
+       SDL_Surface *surface = gfx_createSurface(width, height);
+
+       SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue));
+
+       SDL_SetSurfaceAlphaMod(surface, 128);
+
+       return surface;
+}
+
+void gfx_createMessageBox(SDL_Surface *face, const char *message, int transparent)
+{
+       int x = 60;
+
+       if (gfx_messageBox != NULL)
+       {
+               SDL_FreeSurface(gfx_messageBox);
+               gfx_messageBox = NULL;
+       }
+
+       if (transparent)
+               gfx_messageBox = gfx_createAlphaRect(550, 60, 0x00, 0x00, 0x00);
+       else
+               gfx_messageBox = gfx_createSurface(550, 60);
+
+       if (face != NULL)
+       {
+               gfx_drawRect(gfx_messageBox, 0, 0, gfx_messageBox->w - 1, gfx_messageBox->h - 1, 0x00, 0x00, 0xaa);
+               gfx_blit(face, 5, 5, gfx_messageBox);
+       }
+       else
+       {
+               gfx_drawRect(gfx_messageBox, 0, 0, gfx_messageBox->w - 1, gfx_messageBox->h - 1, 0x00, 0x00, 0x00);
+               x = 10;
+       }
+
+       gfx_renderString(message, x, 5, FONT_WHITE, 1, gfx_messageBox);
+}
+
+SDL_Surface *gfx_loadImage(const char *filename)
+{
+       SDL_Surface *image, *newImage;
+
+       image = IMG_Load(filename);
+
+       if (image == NULL) {
+               printf("Couldn't load %s: %s\n", filename, SDL_GetError());
+               engine_showError(0, filename);
+       }
+
+       newImage = SDL_ConvertSurface(image, screen->format, 0);
+       if ( newImage ) {
+               SDL_FreeSurface(image);
+       }
+       else
+       {
+               // This happens when we are loading the window icon image
+               newImage = image;
+       }
+
+       return gfx_setTransparent(newImage);
+}
+
+void gfx_free()
+{
+       for (int i = 0 ; i < SP_MAX ; i++)
+       {
+               if (gfx_sprites[i] != NULL)
+               {
+                       SDL_FreeSurface(gfx_sprites[i]);
+                       gfx_sprites[i] = NULL;
+               }
+       }
+
+       for (int i = 0 ; i < FS_MAX ; i++)
+       {
+               if (gfx_faceSprites[i] != NULL)
+               {
+                       SDL_FreeSurface(gfx_faceSprites[i]);
+                       gfx_faceSprites[i] = NULL;
+               }
+       }
+
+       for (int i = 0 ; i < SS_MAX ; i++)
+       {
+               if (gfx_shipSprites[i] != NULL)
+               {
+                       SDL_FreeSurface(gfx_shipSprites[i]);
+                       gfx_shipSprites[i] = NULL;
+               }
+       }
+
+       for (int i = 0 ; i < TS_MAX ; i++)
+       {
+               if (gfx_textSprites[i].image != NULL)
+               {
+                       SDL_FreeSurface(gfx_textSprites[i].image);
+                       gfx_textSprites[i].image = NULL;
+               }
+       }
+
+       for (int i = 0 ; i < SHOP_S_MAX ; i++)
+       {
+               if (gfx_shopSprites[i] != NULL)
+               {
+                       SDL_FreeSurface(gfx_shopSprites[i]);
+                               gfx_shopSprites[i] = NULL;
+               }
+       }
+
+       if (gfx_messageBox != NULL)
+       {
+               SDL_FreeSurface(gfx_messageBox);
+               gfx_messageBox = NULL;
+       }
+}
diff --git a/src/gfx.h b/src/gfx.h
new file mode 100644 (file)
index 0000000..25f6829
--- /dev/null
+++ b/src/gfx.h
@@ -0,0 +1,50 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef GFX_H
+#define GFX_H
+
+#include "Starfighter.h"
+
+extern SDL_Surface *gfx_background;
+extern SDL_Surface *gfx_sprites[SP_MAX];
+extern SDL_Surface *gfx_faceSprites[FS_MAX];
+extern SDL_Surface *gfx_shipSprites[SS_MAX];
+extern SDL_Surface *gfx_fontSprites[FONT_MAX];
+extern SDL_Surface *gfx_shopSprites[SHOP_S_MAX];
+extern textObject gfx_textSprites[TS_MAX];
+extern SDL_Surface *gfx_messageBox;
+
+void gfx_init();
+SDL_Surface *gfx_setTransparent(SDL_Surface *sprite);
+void gfx_blit(SDL_Surface *image, int x, int y, SDL_Surface *dest);
+int gfx_renderString(const char *in, int x, int y, int fontColor, int wrap, SDL_Surface *dest);
+void gfx_putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
+void gfx_drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col);
+void gfx_drawCircle(int xc, int yc, int R, SDL_Surface *PIX, int col);
+void gfx_drawRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue);
+SDL_Surface *gfx_createSurface(int width, int height);
+SDL_Surface *gfx_createTextSurface(const char *inString, int color);
+void gfx_createTextObject(int index, const char *inString, int x, int y, int fontColor);
+SDL_Surface *gfx_createAlphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue);
+void gfx_createMessageBox(SDL_Surface *face, const char *message, int transparent);
+SDL_Surface *gfx_loadImage(const char *filename);
+void gfx_free();
+
+#endif
diff --git a/src/graphics.cpp b/src/graphics.cpp
deleted file mode 100644 (file)
index 94e299a..0000000
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
-Copyright (C) 2003 Parallel Realities
-Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 3
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <ctype.h>
-
-#include "Starfighter.h"
-
-Star star[200];
-
-static unsigned long frameLimit;
-static int thirds;
-
-Uint32 red;
-Uint32 darkRed;
-Uint32 yellow;
-Uint32 darkYellow;
-Uint32 green;
-Uint32 darkGreen;
-Uint32 blue;
-Uint32 darkBlue;
-Uint32 darkerBlue;
-Uint32 black;
-Uint32 white;
-Uint32 lightGrey;
-Uint32 darkGrey;
-SDL_Window *window;
-SDL_Renderer *renderer;
-SDL_Texture *texture;
-SDL_Surface *screen, *background;
-SDL_Surface *shape[MAX_SHAPES];
-SDL_Surface *shipShape[MAX_SHIPSHAPES];
-SDL_Surface *fontShape[MAX_FONTSHAPES];
-SDL_Surface *shopSurface[MAX_SHOPSHAPES];
-bRect *bufferHead;
-bRect *bufferTail;
-textObject textShape[MAX_TEXTSHAPES];
-SDL_Surface *messageBox;
-
-bool collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1)
-{
-       float x1 = x0 + w0;
-       float y1 = y0 + h0;
-
-       float x3 = x2 + w1;
-       float y3 = y2 + h1;
-
-       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
-}
-
-bool collision(object *object1, object *object2)
-{
-       float x0 = object1->x;
-       float y0 = object1->y;
-       float w0 = object1->image[0]->w;
-       float h0 = object1->image[0]->h;
-
-       float x2 = object2->x;
-       float y2 = object2->y;
-       float w1 = object2->image[0]->w;
-       float h1 = object2->image[0]->h;
-
-       float x1 = x0 + w0;
-       float y1 = y0 + h0;
-
-       float x3 = x2 + w1;
-       float y3 = y2 + h1;
-
-       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
-}
-
-bool collision(collectables *object1, object *object2)
-{
-       float x0 = object1->x;
-       float y0 = object1->y;
-       float w0 = object1->image->w;
-       float h0 = object1->image->h;
-
-       float x2 = object2->x;
-       float y2 = object2->y;
-       float w1 = object2->image[0]->w;
-       float h1 = object2->image[0]->h;
-
-       float x1 = x0 + w0;
-       float y1 = y0 + h0;
-
-       float x3 = x2 + w1;
-       float y3 = y2 + h1;
-
-       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
-}
-
-void initGraphics()
-{
-       bufferHead = new bRect;
-       bufferHead->next = NULL;
-       bufferTail = bufferHead;
-
-       for (int i = 0 ; i < MAX_SHAPES ; i++)
-               shape[i] = NULL;
-
-       for (int i = 0 ; i < MAX_SHIPSHAPES ; i++)
-               shipShape[i] = NULL;
-
-       for (int i = 0 ; i < MAX_TEXTSHAPES ; i++)
-               textShape[i].image = NULL;
-
-       for (int i = 0 ; i < MAX_SHOPSHAPES ; i++)
-               shopSurface[i] = NULL;
-
-       for (int i = 0 ; i < MAX_FONTSHAPES ; i++)
-               fontShape[i] = NULL;
-
-       background = NULL;
-       messageBox = NULL;
-
-       frameLimit = 0;
-       thirds = 0;
-       screen = NULL;
-}
-
-SDL_Surface *setTransparent(SDL_Surface *sprite)
-{
-       SDL_SetColorKey(sprite, SDL_TRUE, SDL_MapRGB(sprite->format, 0, 0, 0));
-       return sprite;
-}
-
-void addBuffer(int x, int y, int w, int h)
-{
-       bRect *rect = new bRect;
-
-       rect->next = NULL;
-       rect->x = x;
-       rect->y = y;
-       rect->w = w;
-       rect->h = h;
-
-       bufferTail->next = rect;
-       bufferTail = rect;
-}
-
-void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest)
-{
-       // Exit early if image is not on dest at all
-       if (x + image->w < 0 || x >= dest->w || y + image->h < 0 || y >= dest->h)
-               return;
-
-       // Set up a rectangle to draw to
-       SDL_Rect blitRect;
-
-       blitRect.x = x;
-       blitRect.y = y;
-       blitRect.w = image->w;
-       blitRect.h = image->h;
-
-       /* Blit onto the destination surface */
-       if (SDL_BlitSurface(image, NULL, dest, &blitRect) < 0)
-       {
-               printf("BlitSurface error: %s\n", SDL_GetError());
-               showErrorAndExit(2, "");
-       }
-
-       // Only if it is to the screen, mark the region as damaged
-       if (dest == screen)
-               addBuffer(blitRect.x, blitRect.y, blitRect.w, blitRect.h);
-}
-
-void blit(SDL_Surface *image, int x, int y)
-{
-       blit(image, x, y, screen);
-}
-
-void blitText(int i)
-{
-       blit(textShape[i].image, (int)textShape[i].x, (int)textShape[i].y, screen);
-}
-
-void flushBuffer()
-{
-       bRect *prevRect = bufferHead;
-       bRect *rect = bufferHead;
-       bufferTail = bufferHead;
-
-       while (rect->next != NULL)
-       {
-               rect = rect->next;
-
-               prevRect->next = rect->next;
-               delete rect;
-               rect = prevRect;
-       }
-
-       bufferHead->next = NULL;
-}
-
-void unBuffer()
-{
-       bRect *prevRect = bufferHead;
-       bRect *rect = bufferHead;
-       bufferTail = bufferHead;
-
-       while (rect->next != NULL)
-       {
-               rect = rect->next;
-
-               SDL_Rect blitRect;
-
-               blitRect.x = rect->x;
-               blitRect.y = rect->y;
-               blitRect.w = rect->w;
-               blitRect.h = rect->h;
-
-               if (SDL_BlitSurface(background, &blitRect, screen, &blitRect) < 0)
-               {
-                       printf("BlitSurface error: %s\n", SDL_GetError());
-                       showErrorAndExit(2, "");
-               }
-
-               prevRect->next = rect->next;
-               delete rect;
-               rect = prevRect;
-       }
-
-       bufferHead->next = NULL;
-}
-
-/*
-In 16 bit mode this is slow. VERY slow. Don't write directly to a surface
-that constantly needs updating (eg - the main game screen)
-*/
-static int renderString(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest)
-{
-       int i;
-       int splitword;
-       SDL_Rect area;
-       SDL_Rect letter;
-
-       area.x = x;
-       area.y = y;
-       area.w = 8;
-       area.h = 14;
-
-       letter.y = 0;
-       letter.w = 8;
-       letter.h = 14;
-
-       while (*in != '\0')
-       {
-               if (*in & 0x80)
-               {
-                       if ((unsigned char )in[0] != 0x8e)
-                       {
-                               SDL_Rect kanji;
-
-                               kanji.x = ((in[1] & 0x7f) - 0x21) * 16;
-                               kanji.y = ((in[0] & 0x7f) - 0x21) * 16 + 16;
-                               kanji.w = 16;
-                               kanji.h = 16;
-
-                               area.y -= 1;
-                               if (SDL_BlitSurface(fontShape[fontColor], &kanji, dest, &area) < 0)
-                               {
-                                       printf("BlitSurface error: %s\n", SDL_GetError());
-                                       showErrorAndExit(2, "");
-                               }
-                               area.y += 1;
-                               area.x += 16;
-                       }
-                       else
-                       {
-                               SDL_Rect kana;
-
-                               kana.x = (int )((unsigned char )in[1] - 66) * 8;
-                               kana.y = 0;
-                               kana.w = 8;
-                               kana.h = 14;
-
-                               if (SDL_BlitSurface(fontShape[fontColor], &kana, dest, &area) < 0)
-                               {
-                                       printf("BlitSurface error: %s\n", SDL_GetError());
-                                       showErrorAndExit(2, "");
-                               }
-
-                               area.x += 8;
-                       }
-
-                       if (wrap)
-                       {
-                               if (area.x > (dest->w - 70))
-                               {
-                                       area.y += 16;
-                                       area.x = x;
-                               }
-                       }
-
-                       in += 2;
-               }
-               else
-               {
-                       if (*in != ' ')
-                       {
-                               letter.x = (*in - 33);
-                               letter.x *= 8;
-
-                               /* Blit onto the screen surface */
-                               if (SDL_BlitSurface(fontShape[fontColor], &letter, dest, &area) < 0)
-                               {
-                                       printf("BlitSurface error: %s\n", SDL_GetError());
-                                       showErrorAndExit(2, "");
-                               }
-                       }
-
-                       area.x += 9;
-
-                       if (wrap)
-                       {
-                               if ((area.x > (dest->w - 70)) && (*in == ' '))
-                               {
-                                       area.y += 16;
-                                       area.x = x;
-                               }
-                               else if (area.x > (dest->w - 31))
-                               {
-                                       splitword = 1;
-                                       for (i = 0 ; i < 4 ; i++)
-                                       {
-                                               if (!isalpha(*(in + i)))
-                                               {
-                                                       splitword = 0;
-                                                       break;
-                                               }
-                                       }
-
-                                       if (splitword)
-                                       {
-                                               letter.x = (int)('-') - 33;
-                                               letter.x *= 8;
-                                               if (SDL_BlitSurface(fontShape[fontColor], &letter, dest, &area) < 0)
-                                               {
-                                                       printf("BlitSurface error: %s\n", SDL_GetError());
-                                                       showErrorAndExit(2, "");
-                                               }
-                                               area.y += 16;
-                                               area.x = x;
-                                       }
-                               }
-                       }
-
-                       in++;
-               }
-       }
-
-       return area.y;
-}
-
-int drawString(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest)
-{
-       renderString(in, x, y - 1, FONT_OUTLINE, wrap, dest);
-       renderString(in, x, y + 1, FONT_OUTLINE, wrap, dest);
-       renderString(in, x, y + 2, FONT_OUTLINE, wrap, dest);
-       renderString(in, x - 1, y, FONT_OUTLINE, wrap, dest);
-       renderString(in, x - 2, y, FONT_OUTLINE, wrap, dest);
-       renderString(in, x + 1, y, FONT_OUTLINE, wrap, dest);
-       return renderString(in, x, y, fontColor, wrap, dest);
-}
-
-int drawString(const char *in, int x, int y, int fontColor, SDL_Surface *dest)
-{
-       if (x == -1)
-               x = (dest->w - (strlen(in) * 9)) / 2;
-       return drawString(in, x, y, fontColor, 0, dest);
-}
-
-int drawString(const char *in, int x, int y, int fontColor)
-{
-       if (x == -1)
-               x = (800 - (strlen(in) * 9)) / 2;
-       return drawString(in, x, y, fontColor, 0, screen);
-}
-
-/*
-Finds the location of the requested color within the palette and returns
-it's number. This colors are used for drawing rectangles, circle, etc in
-the correct colors.
-*/
-void setColorIndexes()
-{
-       red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00);
-       darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00);
-
-       yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
-       darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00);
-
-       green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00);
-       darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00);
-
-       blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff);
-       darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x99);
-       darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44);
-
-       black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
-       white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
-       lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc);
-       darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99);
-}
-
-/*
-Draws the background surface that has been loaded
-*/
-void drawBackGround()
-{
-       blit(background, 0, 0, screen);
-}
-
-void clearScreen(Uint32 color)
-{
-       SDL_FillRect(screen, NULL, color);
-}
-
-void updateScreen()
-{
-       SDL_UpdateTexture(texture, NULL, screen->pixels, screen->w * 4);
-       SDL_RenderCopy(renderer, texture, NULL, NULL);
-       SDL_RenderPresent(renderer);
-}
-
-/*
- * Delay until the next 60 Hz frame
- */
-void delayFrame()
-{
-       unsigned long now = SDL_GetTicks();
-
-       // Add 16 2/3 to frameLimit
-       frameLimit += 16;
-       if (thirds >= 2)
-       {
-               thirds = 0;
-       }
-       else
-       {
-               thirds++;
-               frameLimit++;
-       }
-
-       if(now < frameLimit)
-               SDL_Delay(frameLimit - now);
-       else
-               frameLimit = now;
-}
-
-/*
- * Set the pixel at (x, y) to the given value
- * NOTE: The surface must be locked before calling this!
- */
-void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
-{
-       int bpp = surface->format->BytesPerPixel;
-       /* Here p is the address to the pixel we want to set */
-       Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
-
-       switch(bpp)
-       {
-               case 1:
-                       *p = pixel;
-                       break;
-
-               case 2:
-                       *(Uint16 *)p = pixel;
-                       break;
-
-               case 3:
-                       if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-                       {
-                               p[0] = (pixel >> 16) & 0xff;
-                               p[1] = (pixel >> 8) & 0xff;
-                               p[2] = pixel & 0xff;
-                       }
-                       else
-                       {
-                               p[0] = pixel & 0xff;
-                               p[1] = (pixel >> 8) & 0xff;
-                               p[2] = (pixel >> 16) & 0xff;
-                       }
-                       break;
-
-                case 4:
-                       *(Uint32 *)p = pixel;
-                       break;
-       }
-}
-
-void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col)
-{
-       int counter = 0;
-
-       if ( SDL_MUSTLOCK(dest) )
-       {
-               if ( SDL_LockSurface(dest) < 0 )
-               {
-                       printf("Can't lock screen: %s\n", SDL_GetError());
-                       showErrorAndExit(2, "");
-               }
-       }
-
-       while(1)
-       {
-               putpixel(dest, x1, y1, col);
-
-               if (x1 > x2) x1--;
-               if (x1 < x2) x1++;
-               if (y1 > y2) y1--;
-               if (y1 < y2) y1++;
-
-               if ((x1 == x2) && (y1 == y2))
-                       {break;}
-               if (counter == 1000)
-                       {printf("Loop Error!\n"); break;}
-               counter++;
-       }
-
-       if (SDL_MUSTLOCK(dest))
-       {
-               SDL_UnlockSurface(dest);
-       }
-}
-
-void drawLine(int x1, int y1, int x2, int y2, int col)
-{
-       drawLine(screen, x1, y1, x2, y2, col);
-}
-
-/*
-A quick(?) circle draw function. This code was posted to the SDL
-mailing list... I didn't write it myself.
-*/
-void circle(int xc, int yc, int R, SDL_Surface *PIX, int col)
-{
-       int x = 0, xx = 0;
-       int y = R, yy = 2 * R;
-       int p = 1 - R;
-
-       putpixel(PIX, xc, yc - y, col);
-       putpixel(PIX, xc, yc + y, col);
-       putpixel(PIX, xc - y, yc, col);
-       putpixel(PIX, xc + y, yc, col);
-
-       while (x < y)
-       {
-               xx += 2;
-               x++;
-               if (p >= 0)
-               {
-                       yy -= 2;
-                       y--;
-                       p -= yy;
-               }
-               p += xx + 1;
-
-               putpixel(PIX, xc - x, yc - y, col);
-               putpixel(PIX, xc + x, yc - y, col);
-               putpixel(PIX, xc - x, yc + y, col);
-               putpixel(PIX, xc + x, yc + y, col);
-               putpixel(PIX, xc - y, yc - x, col);
-               putpixel(PIX, xc + y, yc - x, col);
-               putpixel(PIX, xc - y, yc + x, col);
-               putpixel(PIX, xc + y, yc + x, col);
-       }
-
-       if ((x = y))
-       {
-               putpixel(PIX, xc - x, yc - y, col);
-               putpixel(PIX, xc + x, yc - y, col);
-               putpixel(PIX, xc - x, yc + y, col);
-               putpixel(PIX, xc + x, yc + y, col);
-       }
-}
-
-void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue)
-{
-       SDL_Rect r = {(int16_t)x, (int16_t)y, (uint16_t)w, (uint16_t)h};
-       SDL_FillRect(dest, &r, SDL_MapRGB(screen->format, red, green, blue));
-
-       drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255));
-       drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255));
-       drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128));
-       drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128));
-}
-
-void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue)
-{
-       blevelRect(screen, x, y, w, h, red, green, blue);
-}
-
-SDL_Surface *createSurface(int width, int height)
-{
-       SDL_Surface *surface;
-       Uint32 rmask, gmask, bmask, amask;
-
-       /* SDL interprets each pixel as a 32-bit number, so our masks must depend
-       on the endianness (byte order) of the machine */
-       #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
-               rmask = 0xff000000;
-               gmask = 0x00ff0000;
-               bmask = 0x0000ff00;
-               amask = 0x000000ff;
-       #else
-               rmask = 0x000000ff;
-               gmask = 0x0000ff00;
-               bmask = 0x00ff0000;
-               amask = 0xff000000;
-       #endif
-
-       surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, rmask, gmask, bmask, amask);
-
-       if (surface == NULL) {
-               printf("CreateRGBSurface failed: %s\n", SDL_GetError());
-               showErrorAndExit(2, "");
-       }
-
-       return surface;
-}
-
-SDL_Surface *textSurface(const char *inString, int color)
-{
-       SDL_Surface *surface = createSurface(strlen(inString) * 9, 16);
-
-       drawString(inString, 1, 1, color, surface);
-
-       return setTransparent(surface);
-}
-
-void textSurface(int index, const char *inString, int x, int y, int fontColor)
-{
-       /* Shortcut: if we already rendered the same string in the same color, don't render it again. */
-       if(textShape[index].text && textShape[index].image && textShape[index].fontColor == fontColor && !strcmp(textShape[index].text, inString)) {
-               textShape[index].x = x;
-               textShape[index].y = y;
-               if (x == -1)
-                       textShape[index].x = (800 - textShape[index].image->w) / 2;
-               return;
-       }
-
-       strcpy(textShape[index].text, inString);
-       textShape[index].x = x;
-       textShape[index].y = y;
-       textShape[index].fontColor = fontColor;
-       if (textShape[index].image != NULL)
-       {
-               SDL_FreeSurface(textShape[index].image);
-       }
-       textShape[index].image = textSurface(inString, fontColor);
-       if (x == -1)
-               textShape[index].x = (800 - textShape[index].image->w) / 2;
-}
-
-SDL_Surface *alphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue)
-{
-       SDL_Surface *surface = createSurface(width, height);
-
-       SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue));
-
-       SDL_SetSurfaceAlphaMod(surface, 128);
-
-       return surface;
-}
-
-void createMessageBox(SDL_Surface *face, const char *message, signed char transparent)
-{
-       if (messageBox != NULL)
-       {
-               SDL_FreeSurface(messageBox);
-               messageBox = NULL;
-       }
-
-       if (transparent)
-               messageBox = alphaRect(550, 60, 0x00, 0x00, 0x00);
-       else
-               messageBox = createSurface(550, 60);
-
-       signed char x = 60;
-
-       if (face != NULL)
-       {
-               blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0xaa);
-               blit(face, 5, 5, messageBox);
-       }
-       else
-       {
-               blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0x00);
-               x = 10;
-       }
-
-       drawString(message, x, 5, FONT_WHITE, 1, messageBox);
-}
-
-void freeGraphics()
-{
-       for (int i = 0 ; i < MAX_SHAPES ; i++)
-       {
-               if (shape[i] != NULL)
-               {
-                       SDL_FreeSurface(shape[i]);
-                       shape[i] = NULL;
-               }
-       }
-
-       for (int i = 0 ; i < MAX_SHIPSHAPES ; i++)
-       {
-               if (shipShape[i] != NULL)
-               {
-                       SDL_FreeSurface(shipShape[i]);
-                       shipShape[i] = NULL;
-               }
-       }
-
-       for (int i = 0 ; i < MAX_TEXTSHAPES ; i++)
-       {
-               if (textShape[i].image != NULL)
-               {
-                       SDL_FreeSurface(textShape[i].image);
-                       textShape[i].image = NULL;
-               }
-       }
-
-       for (int i = 0 ; i < MAX_SHOPSHAPES ; i++)
-       {
-               if (shopSurface[i] != NULL)
-               {
-                       SDL_FreeSurface(shopSurface[i]);
-                               shopSurface[i] = NULL;
-               }
-       }
-
-       if (messageBox != NULL)
-       {
-               SDL_FreeSurface(messageBox);
-               messageBox = NULL;
-       }
-}
-
-
-SDL_Surface *loadImage(const char *filename)
-{
-       SDL_Surface *image, *newImage;
-
-       image = IMG_Load(filename);
-
-       if (image == NULL) {
-               printf("Couldn't load %s: %s\n", filename, SDL_GetError());
-               showErrorAndExit(0, filename);
-       }
-
-       newImage = SDL_ConvertSurface(image, screen->format, 0);
-       if ( newImage ) {
-               SDL_FreeSurface(image);
-       } else {
-               // This happens when we are loading the window icon image
-               newImage = image;
-       }
-
-       return setTransparent(newImage);
-}
-
-/*
-Simply draws the stars in their positions on screen and moves
-them around.
-*/
-void doStarfield()
-{
-       /* Lock the screen for direct access to the pixels */
-       if (SDL_MUSTLOCK(screen))
-       {
-               if (SDL_LockSurface(screen) < 0 )
-                       showErrorAndExit(2, "");
-       }
-
-       int color = 0;
-
-       SDL_Rect r;
-
-       for (int i = 0 ; i < 200 ; i++)
-       {
-               if (star[i].speed == 3)
-                       color = white;
-               else if (star[i].speed == 2)
-                       color = lightGrey;
-               else if (star[i].speed == 1)
-                       color = darkGrey;
-
-               WRAP_ADD(star[i].x, (engine.ssx + engine.smx) * star[i].speed, 0,
-                       screen->w - 1);
-               WRAP_ADD(star[i].y, (engine.ssy + engine.smy) * star[i].speed, 0,
-                       screen->h - 1);
-
-               putpixel(screen, (int)star[i].x, (int)star[i].y, color);
-               r.x = (int)star[i].x;
-               r.y = (int)star[i].y;
-               r.w = 1;
-               r.h = 1;
-
-               addBuffer(r.x, r.y, r.w, r.h);
-       }
-
-       if (SDL_MUSTLOCK(screen))
-       {
-               SDL_UnlockSurface(screen);
-       }
-}
diff --git a/src/graphics.h b/src/graphics.h
deleted file mode 100644 (file)
index 3f4e71f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-Copyright (C) 2003 Parallel Realities
-Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 3
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef GRAPHICS_H
-#define GRAPHICS_H
-
-extern Star star[200];
-
-extern Uint32 red;
-extern Uint32 darkRed;
-extern Uint32 yellow;
-extern Uint32 darkYellow;
-extern Uint32 green;
-extern Uint32 darkGreen;
-extern Uint32 blue;
-extern Uint32 darkBlue;
-extern Uint32 darkerBlue;
-extern Uint32 black;
-extern Uint32 white;
-extern Uint32 lightGrey;
-extern Uint32 darkGrey;
-extern SDL_Window *window;
-extern SDL_Renderer *renderer;
-extern SDL_Texture *texture;
-extern SDL_Surface *screen, *background;
-extern SDL_Surface *shape[MAX_SHAPES];
-extern SDL_Surface *shipShape[MAX_SHIPSHAPES];
-extern SDL_Surface *fontShape[MAX_FONTSHAPES];
-extern SDL_Surface *shopSurface[MAX_SHOPSHAPES];
-extern bRect *bufferHead;
-extern bRect *bufferTail;
-extern textObject textShape[MAX_TEXTSHAPES];
-extern SDL_Surface *messageBox;
-
-
-extern bool collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1);
-extern bool collision(object *object1, object *object2);
-extern bool collision(collectables *object1, object *object2);
-
-extern void initGraphics();
-extern SDL_Surface *setTransparent(SDL_Surface *sprite);
-extern void addBuffer(int x, int y, int w, int h);
-extern void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest);
-extern void blit(SDL_Surface *image, int x, int y);
-extern void blitText(int i);
-extern void flushBuffer();
-extern void unBuffer();
-extern int drawString(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest);
-extern int drawString(const char *in, int x, int y, int fontColor, SDL_Surface *dest);
-extern int drawString(const char *in, int x, int y, int fontColor);
-extern void setColorIndexes();
-extern void drawBackGround();
-extern void clearScreen(Uint32 color);
-extern void updateScreen();
-extern void delayFrame();
-extern void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
-extern void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col);
-extern void drawLine(int x1, int y1, int x2, int y2, int col);
-extern void circle(int xc, int yc, int R, SDL_Surface *PIX, int col);
-extern void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue);
-extern void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue);
-extern SDL_Surface *createSurface(int width, int height);
-extern SDL_Surface *textSurface(const char *inString, int color);
-extern void textSurface(int index, const char *inString, int x, int y, int fontColor);
-extern SDL_Surface *alphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue);
-extern void createMessageBox(SDL_Surface *face, const char *message, signed char transparent);
-extern void freeGraphics();
-
-extern SDL_Surface *loadImage(const char *filename);
-extern void doStarfield();
-
-#endif
diff --git a/src/init.cpp b/src/init.cpp
deleted file mode 100644 (file)
index 89a2665..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
-Copyright (C) 2003 Parallel Realities
-Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 3
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "Starfighter.h"
-
-#include <sys/types.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <errno.h>
-
-/*
-Initalises a whole load of variables
-*/
-void initVars()
-{
-       srand(time(NULL));
-
-       for (int i = 0 ; i < (int)(screen->w * screen->h / 2400) ; i++)
-       {
-               star[i].x = rand() % screen->w;
-               star[i].y = rand() % screen->h;
-               star[i].speed = 1 + (rand() % 3);
-       }
-
-       if (engine.useAudio)
-       {
-               Mix_Volume(-1, 100);
-               Mix_VolumeMusic(engine.musicVolume);
-       }
-}
-
-/*
-Something went wrong. This stops the game, present the error message and
-prompts the user to press space or ctrl to exit the game. This is unlikely to
-be seen by people unless something really stoopid happens!
-*/
-void showErrorAndExit(int errorId, const char *name)
-{
-       clearScreen(black);
-
-       if (errorId != 2)
-       {
-               drawString("A file error has occurred", -1, 200, FONT_RED);
-       }
-       else
-       {
-               printf("Couldn't create or write to directory '%s'\n", name);
-               exit(1);
-       }
-
-       char string[255];
-
-       switch(errorId)
-       {
-               case 0:
-                       sprintf(string, "%s was not found in the Starfighter data package", name);
-                       drawString(string, -1, 250, FONT_WHITE);
-                       drawString("Please try again. If this error persists, contact the authors", -1, 275, FONT_WHITE);
-                       drawString("or reinstall the game", -1, 300, FONT_WHITE);
-                       break;
-               case 1:
-                       drawString("Project: Starfighter encountered an error whilst", -1, 250, FONT_WHITE);
-                       drawString("attempting to load game data. Please try running", -1, 275, FONT_WHITE);
-                       drawString("the game again. If the errors persist, reinstall the game", -1, 300, FONT_WHITE);
-                       break;
-               case 2:
-                       drawString("Project: Starfighter encountered a critical error", -1, 250, FONT_WHITE);
-                       drawString("while attempting to perform a required program function.", -1, 275, FONT_WHITE);
-                       drawString("Please contact the authors with details.", -1, 300, FONT_WHITE);
-                       break;
-       }
-
-       drawString("Project: Starfighter will now exit", -1, 450, FONT_WHITE);
-       drawString("Press Space to continue", -1, 475, FONT_WHITE);
-
-       updateScreen();
-
-       engine.keyState[KEY_ALTFIRE] = 0;
-
-       while (!engine.keyState[KEY_ALTFIRE])
-       {
-               getPlayerInput();
-               delayFrame();
-       }
-
-       exit(1);
-}
-
-/*
-This gets the user's home directory, then creates the .parallelrealities
-and .parallelrealities/starfighter directories so that saves and
-temporary data files can be written there.
-*/
-static void setupUserHomeDirectory()
-{
-       const char *userHome;
-
-       if ((userHome = getenv("HOME")) == NULL)
-               userHome = getpwuid(getuid())->pw_dir;
-
-       char dir[PATH_MAX];
-       strcpy(dir, "");
-
-       sprintf(dir, "%s/.parallelrealities", userHome);
-       if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
-               showErrorAndExit(2, dir);
-
-       sprintf(dir, "%s/.parallelrealities/starfighter", userHome);
-       if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
-               showErrorAndExit(2, dir);
-
-       sprintf(engine.userHomeDirectory, "%s/.parallelrealities/starfighter/", userHome);
-}
-
-/*
-Chugg chugg chugg.... brrr... chugg chugg chugg...brrrrrr... chugg ch..
-BRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMM!! Well, hopefully anyway! ;)
-*/
-void initSystem()
-{
-       strcpy(engine.userHomeDirectory, "");
-
-       setupUserHomeDirectory();
-
-       /* Initialize the SDL library */
-       if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
-       {
-               printf("Couldn't initialize SDL: %s\n", SDL_GetError());
-               exit(1);
-       }
-
-       char filename[PATH_MAX];
-       int fullScreen = 0;
-       int useSound = 1;
-       int useMusic = 1;
-       int autoPause = 0;
-
-       FILE *fp;
-       sprintf(filename, "%sconf", engine.userHomeDirectory);
-       fp = fopen(filename, "rb");
-
-       if (fp != NULL)
-       {
-               if (fscanf(fp, "%d %d %d %d", &fullScreen, &useSound, &useMusic, &autoPause) < 4)
-                       printf("Warning: Config file \"%s\" is not correctly formatted\n", filename);
-               fclose(fp);
-       }
-
-       engine.fullScreen = fullScreen;
-       engine.useSound = useSound;
-       engine.useMusic = useMusic;
-       engine.autoPause = autoPause;
-
-       screen = SDL_CreateRGBSurface(0, screenWidth, screenHeight, 32, 0xff0000, 0xff00, 0xff, 0xff000000);
-
-       if (!screen)
-       {
-               printf("Couldn't create %ix%ix32 surface: %s\n", screenWidth, screenHeight, SDL_GetError());
-               exit(1);
-       }
-
-       window = SDL_CreateWindow("Project: Starfighter", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, screen->w, screen->h, 0);
-
-       if (window == NULL)
-       {
-               printf("Could not create window: %s\n", SDL_GetError());
-               exit(1);
-       }
-
-       SDL_SetWindowIcon(window, loadImage("gfx/alienDevice.png"));
-       SDL_SetWindowFullscreen(window, engine.fullScreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
-
-       renderer = SDL_CreateRenderer(window, -1, 0);
-
-       if (!renderer)
-       {
-               printf("Could not create renderer: %s\n", SDL_GetError());
-               exit(1);
-       }
-
-       SDL_RenderSetLogicalSize(renderer, screen->w, screen->h);
-
-       texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, screen->w, screen->h);
-
-       if (!texture)
-       {
-               printf("Couldn't create %ix%ix32 texture: %s\n", screen->w, screen->h, SDL_GetError());
-               exit(1);
-       }
-
-       if (engine.useAudio)
-       {
-               if (Mix_OpenAudio(44100, AUDIO_S16, engine.useAudio * 2, 1024) < 0)
-               {
-                       printf("Warning: Couldn't set 44100 Hz 16-bit stereo audio - Reason:\n%s\n", Mix_GetError());
-                       printf("Sound and Music will be disabled\n");
-                       engine.useAudio = false;
-               }
-       }
-
-       SDL_ShowCursor(SDL_DISABLE);
-       SDL_EventState(SDL_MOUSEMOTION, SDL_DISABLE);
-
-       SDL_JoystickEventState(SDL_ENABLE);
-       SDL_JoystickOpen(0);
-}
-
-/*
-Removes [hopefully] all the resources that has been
-loaded and created during the game. This is called by
-atexit();
-*/
-void cleanUp()
-{
-       freeGraphics();
-       SDL_FreeSurface(background);
-       audio_free();
-       resetLists();
-       delete(engine.bulletHead);
-       delete(engine.explosionHead);
-       delete(engine.collectableHead);
-       delete(bufferHead);
-
-       for (int i = 0 ; i < MAX_FONTSHAPES ; i++)
-       {
-               if (fontShape[i] != NULL)
-                       SDL_FreeSurface(fontShape[i]);
-       }
-
-       char filename[PATH_MAX];
-       strcpy(filename, "");
-       
-       sprintf(filename, "%smusic.mod", engine.userHomeDirectory);
-       remove(filename);
-
-       sprintf(filename, "%smusic.s3m", engine.userHomeDirectory);
-       remove(filename);
-
-       if (engine.useAudio)
-       {
-               Mix_CloseAudio();
-       }
-
-       // Save the config using current settings
-       FILE *fp;
-       sprintf(filename, "%sconf", engine.userHomeDirectory);
-       fp = fopen(filename, "wb");
-       if (fp != NULL)
-       {
-               fprintf(fp, "%d %d %d %d\n", engine.fullScreen, engine.useSound,
-                       engine.useMusic, engine.autoPause);
-               fclose(fp);
-       }
-       else
-       {
-               printf("Error saving config\n");
-       }
-
-       SDL_Quit();
-       printf("Thank You for playing Starfighter\n");
-}
-
index e30565f..8fd40cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -26,9 +26,9 @@ static void intermission_doCursor()
 {
        getPlayerInput();
 
-       LIMIT(engine.cursor_x, 10, screen->w - 10 - shape[0]->w);
-       LIMIT(engine.cursor_y, 10, screen->h - 10 - shape[0]->h);
-       blit(shape[0], engine.cursor_x, engine.cursor_y);
+       LIMIT(engine.cursor_x, 10, screen->w - 10 - gfx_sprites[SP_CURSOR]->w);
+       LIMIT(engine.cursor_y, 10, screen->h - 10 - gfx_sprites[SP_CURSOR]->h);
+       screen_blit(gfx_sprites[SP_CURSOR], engine.cursor_x, engine.cursor_y);
 }
 
 /*
@@ -39,127 +39,97 @@ These are set only once.
 static void intermission_setStatusLines()
 {
        char string[50];
-
-       sprintf(string, "À±·Ï : %s·Ï", systemNames[game.system]);
-
-       textSurface(0, string, 0, 0, FONT_WHITE);
-
-       signed char total = 0;
-       signed char completed = 0;
-       
-       for (int i = 0 ; i < 10 ; i++)
-       {
-               if (systemPlanet[i].missionNumber > -1)
-               {
-                       switch(systemPlanet[i].missionCompleted)
-               {
-                               case 0:
-                                       total++;
-                                       break;
-                               case 1:
-                                       total++;
-                                       completed++;
-                                       break;
-                       }
-               }
-       }
-
-       for (int i = 0 ; i < 30 ; i++)
-               textSurface(i, "", 0, 0, FONT_WHITE);
-
-       sprintf(string, "´°Î»¤·¤¿ºîÀï : %d/%d", completed, total);
-       textSurface(1, string, 0, 0, FONT_WHITE);
+       int timeTaken = game.timeTaken;
+       int y;
 
        sprintf(string, "·â¤Ã¤¿ÃƤοô : %d", game.shots);
-       textSurface(2, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_SHOTS_FIRED, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "Ì¿Ã椷¤¿ÃƤοô : %d", game.hits);
-       textSurface(3, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_HITS_SCORED, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "Ì¿ÃæΨ : %d%%", game.accuracy);
-       textSurface(4, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_ACCURACY, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "¥×¥ì¥¤¥ä¡¼°Ê³°¤Ë·âÄƤµ¤ì¤¿Å¨¤Î¿ô : %d", game.totalOtherKills);
-       textSurface(5, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_OTHER_KILLS, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "²Ô¤¤¤ÀÁ÷¶â³Û : %d", game.cashEarned);
-       textSurface(6, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CASH_EARNED, string, 0, 0, FONT_WHITE);
 
-       textSurface(7, "*** ¥¯¥ê¥¹ ***", 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_HEADER, "*** ¥¯¥ê¥¹ ***", 0, 0, FONT_WHITE);
 
        sprintf(string, "·âÄÆ¿ô : %d", game.totalKills);
-       textSurface(8, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_KILLS, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "³ÍÆÀ¤·¤¿¥·¡¼¥ë¥É²óÉü¤Î¿ô : %d", game.shieldPickups);
-       textSurface(9, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_SHIELD_PICKUPS, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "³ÍÆÀ¤·¤¿¥×¥é¥º¥Þ¥»¥ë¤Î¿ô : %d", game.cellPickups);
-       textSurface(10, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_PLASMA_PICKUPS, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "³ÍÆÀ¤·¤¿¥í¥±¥Ã¥ÈÃƤοô : %d", game.rocketPickups);
-       textSurface(11, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_ROCKET_PICKUPS, string, 0, 0, FONT_WHITE);
 
-       sprintf(string, "³ÍÆÀ¤·¤¿¥Ñ¥ï¡¼¥¢¥Ã¥×¤Î¿ô : %d", game.rocketPickups);
-       textSurface(12, string, 0, 0, FONT_WHITE);
+       sprintf(string, "³ÍÆÀ¤·¤¿¥Ñ¥ï¡¼¥¢¥Ã¥×¤Î¿ô : %d", game.powerups);
+       gfx_createTextObject(TS_CHRIS_POWERUP_PICKUPS, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "Ç˲õ¤·¤¿µ¡Íë¤Î¿ô : %d", game.minesKilled);
-       textSurface(13, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_MINES_KILLED, string, 0, 0, FONT_WHITE);
 
        sprintf(string, "µß½Ð¤·¤¿ÅÛÎì¤Î¿Í¿ô : %d", game.slavesRescued);
-       textSurface(14, string, 0, 0, FONT_WHITE);
-
-       sprintf(string, "²ó¼ý¤·¤¿²ßʪ¤Î¿ô : %d", game.cargoPickups);
-       textSurface(15, string, 0, 0, FONT_WHITE);
+       gfx_createTextObject(TS_CHRIS_SLAVES_RESCUED, string, 0, 0, FONT_WHITE);
 
        if (game.hasWingMate1)
        {
-               textSurface(16, "*** ¥Õ¥§¡¼¥Ù ***", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_PHOEBE_HEADER, "*** ¥Õ¥§¡¼¥Ù ***", 0, 0, FONT_WHITE);
 
                sprintf(string, "·âÄÆ¿ô : %d", game.wingMate1Kills);
-               textSurface(17, string, 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_PHOEBE_KILLS, string, 0, 0, FONT_WHITE);
 
                sprintf(string, "æ½Ð¤·¤¿²ó¿ô : %d", game.wingMate1Ejects);
-               textSurface(18, string, 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_PHOEBE_DEATHS, string, 0, 0, FONT_WHITE);
+       }
+       else
+       {
+               gfx_createTextObject(TS_PHOEBE_HEADER, "", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_PHOEBE_KILLS, "", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_PHOEBE_DEATHS, "", 0, 0, FONT_WHITE);
        }
 
        if (game.hasWingMate2)
        {
-               textSurface(19, "*** ¥¦¡¼¥·¥å¥é ***", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_URSULA_HEADER, "*** ¥¦¡¼¥·¥å¥é ***", 0, 0, FONT_WHITE);
 
                sprintf(string, "·âÄÆ¿ô : %d", game.wingMate2Kills);
-               textSurface(20, string, 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_URSULA_KILLS, string, 0, 0, FONT_WHITE);
 
                sprintf(string, "æ½Ð¤·¤¿²ó¿ô : %d", game.wingMate2Ejects);
-               textSurface(21, string, 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_URSULA_DEATHS, string, 0, 0, FONT_WHITE);
+       }
+       else
+       {
+               gfx_createTextObject(TS_URSULA_HEADER, "", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_URSULA_KILLS, "", 0, 0, FONT_WHITE);
+               gfx_createTextObject(TS_URSULA_DEATHS, "", 0, 0, FONT_WHITE);
        }
 
-       signed char percentage = 0;
-       if ((game.secondaryMissions > 0) && (game.secondaryMissionsCompleted > 0))
-               percentage = (game.secondaryMissionsCompleted / game.secondaryMissions) * 100;
-       sprintf(string, "Seconday Missions Completed : %d / %d (%d%%)", game.secondaryMissionsCompleted, game.secondaryMissions, percentage);
-       textSurface(24, string, 0, 0, FONT_WHITE);
-
-       int timeTaken = game.timeTaken;
+       gfx_createTextObject(TS_STATUS_HEADER, "¸½ºß¤Î¾õÂÖ", -1, 83, FONT_WHITE);
 
        snprintf(string, sizeof string, "Áí»þ´Ö : %2d:%02d:%02d", timeTaken / 3600, (timeTaken / 60) % 60, timeTaken % 60);
+       gfx_createTextObject(TS_STATUS_FOOTER, string, -1, 404, FONT_WHITE);
 
-       textSurface(26, string, -1, 0, FONT_WHITE);
-       textSurface(27, "¸½ºß¤Î¾õÂÖ", -1, 0, FONT_WHITE);
-
-       textShape[0].y = 400;
-       textShape[0].x = 150;
-
-       for (int i = 1 ; i < 25 ; i++)
+       y = 400;
+       for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
        {
-               textShape[i].y = textShape[i - 1].y + 20;
-               if ((i == 7) || (i == 16) || (i == 19))
-                       textShape[i].y += 25;
+               y += 20;
+               if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
+                               (i == TS_URSULA_HEADER))
+                       y += 25;
 
-               textShape[i].x = 150;
+               gfx_textSprites[i].x = 150;
+               gfx_textSprites[i].y = y;
        }
-
-       textShape[26].y = 404;
-       textShape[27].y = 83;
 }
 
 /*
@@ -167,71 +137,265 @@ Sets the names and stats of the planets within the current system.
 */
 static void intermission_setSystemPlanets()
 {
-       FILE *fp;
-
-       char string[100];
-       strcpy(string, "");
+       for (int i = 0 ; i < 10 ; i++)
+       {
+               systemPlanet[i].y = -1;
+               strcpy(systemPlanet[i].name, "");
+               systemPlanet[i].image = NULL;
+               systemPlanet[i].messageMission = -1;
+               systemPlanet[i].messageSlot = -1;
+               systemPlanet[i].faceImage = -1;
+               strcpy(systemPlanet[i].subject, "ERROR");
+       }
 
        switch (game.system)
        {
-               case 0:
-                       strcpy(string, "data/planets_spirit.dat");
-                       break;
-               case 1:
-                       strcpy(string, "data/planets_eyananth.dat");
-                       break;
-               case 2:
-                       strcpy(string, "data/planets_mordor.dat");
-                       break;
-               case 3:
-                       strcpy(string, "data/planets_sol.dat");
+               case SYSTEM_SPIRIT:
+                       systemPlanet[PLANET_HAIL].y = 15;
+                       strcpy(systemPlanet[PLANET_HAIL].name, "¥Ï¥¤¥ë");
+                       systemPlanet[PLANET_HAIL].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_CERADSE].y = 30;
+                       strcpy(systemPlanet[PLANET_CERADSE].name, "¥»¥é¥É¥»");
+                       systemPlanet[PLANET_CERADSE].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_HINSTAG].y = 30;
+                       strcpy(systemPlanet[PLANET_HINSTAG].name, "¥Ò¥ó¥¹¥¿¥°");
+                       systemPlanet[PLANET_HINSTAG].image = gfx_sprites[SP_PLANET_RED];
+
+                       systemPlanet[PLANET_JOLDAR].y = 20;
+                       strcpy(systemPlanet[PLANET_JOLDAR].name, "¥¸¥ç¥ë¥À¡¼");
+                       systemPlanet[PLANET_JOLDAR].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_MOEBO].y = 40;
+                       strcpy(systemPlanet[PLANET_MOEBO].name, "¥â¥¨¥Ü");
+                       systemPlanet[PLANET_MOEBO].image = gfx_sprites[SP_PLANET_ORANGE];
+
+                       systemPlanet[PLANET_HAIL].messageMission = MISN_HAIL;
+                       systemPlanet[PLANET_HAIL].messageSlot = 0;
+                       systemPlanet[PLANET_HAIL].faceImage = FS_KRASS;
+                       strcpy(systemPlanet[PLANET_HAIL].subject, "WEAPCO¤Î·±Îý½ê¤ÎÇ˲õ");
+
+                       systemPlanet[PLANET_CERADSE].messageMission = MISN_CERADSE;
+                       systemPlanet[PLANET_CERADSE].messageSlot = 1;
+                       systemPlanet[PLANET_CERADSE].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_CERADSE].subject, "6¤Ä¤ÎÀѲ٤βó¼ý");
+
+                       systemPlanet[PLANET_HINSTAG].messageMission = MISN_HINSTAG;
+                       systemPlanet[PLANET_HINSTAG].messageSlot = 2;
+                       systemPlanet[PLANET_HINSTAG].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_HINSTAG].subject, "5ÀɤÎWEAPCO¥ß¥µ¥¤¥ëÄú¤ÎÇ˲õ");
+
+                       systemPlanet[PLANET_JOLDAR].messageMission = MISN_JOLDAR;
+                       systemPlanet[PLANET_JOLDAR].messageSlot = 3;
+                       systemPlanet[PLANET_JOLDAR].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_JOLDAR].subject, "¥¸¥ç¥ë¥À¡¼¼þÊդε¡Íë¤Î½üµî");
+
+                       systemPlanet[PLANET_MOEBO].messageMission = MISN_MOEBO;
+                       systemPlanet[PLANET_MOEBO].messageSlot = 0;
+                       systemPlanet[PLANET_MOEBO].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_MOEBO].subject, "WEAPCO¥Õ¥ê¥²¡¼¥È¤ÎÇ˲õ");
+
                        break;
-       }
 
-       fp = fopen(string, "rb");
+               case SYSTEM_EYANANTH:
+                       strcpy(systemPlanet[PLANET_RESCUESLAVES].name, "WEAPCO¤Î·Þ·âÉôÂâ");
 
-       int distance;
-       char name[50];
-       int image;
+                       systemPlanet[PLANET_NEROD].y = 15;
+                       strcpy(systemPlanet[PLANET_NEROD].name, "¥Í¥í¥É");
+                       systemPlanet[PLANET_NEROD].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_ALLEZ].y = 30;
+                       strcpy(systemPlanet[PLANET_ALLEZ].name, "¥¢¥ì¥º");
+                       systemPlanet[PLANET_ALLEZ].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_URUSOR].y = 30;
+                       strcpy(systemPlanet[PLANET_URUSOR].name, "¥¦¥ë¥½¥ë");
+                       systemPlanet[PLANET_URUSOR].image = gfx_sprites[SP_PLANET_RED];
+
+                       systemPlanet[PLANET_DORIM].y = 20;
+                       strcpy(systemPlanet[PLANET_DORIM].name, "¥É¥ê¥à");
+                       systemPlanet[PLANET_DORIM].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_ELAMALE].y = 40;
+                       strcpy(systemPlanet[PLANET_ELAMALE].name, "¥¨¥é¥á¡¼¥ë");
+                       systemPlanet[PLANET_ELAMALE].image = gfx_sprites[SP_PLANET_ORANGE];
+
+                       systemPlanet[PLANET_RESCUESLAVES].messageMission = MISN_RESCUESLAVES;
+                       systemPlanet[PLANET_RESCUESLAVES].messageSlot = 0;
+                       systemPlanet[PLANET_RESCUESLAVES].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_RESCUESLAVES].subject, "ÅÛÎì¤Îµß½Ð");
+
+                       systemPlanet[PLANET_NEROD].messageMission = MISN_NEROD;
+                       systemPlanet[PLANET_NEROD].messageSlot = 1;
+                       systemPlanet[PLANET_NEROD].faceImage = FS_PHOEBE;
+                       strcpy(systemPlanet[PLANET_NEROD].subject, "SOS");
+
+                       systemPlanet[PLANET_ALLEZ].messageMission = MISN_ALLEZ;
+                       systemPlanet[PLANET_ALLEZ].messageSlot = 2;
+                       systemPlanet[PLANET_ALLEZ].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_ALLEZ].subject, "°åÌôÉʤÎÍ¢Á÷Á¥¤Îµß½õ");
+
+                       systemPlanet[PLANET_URUSOR].messageMission = MISN_URUSOR;
+                       systemPlanet[PLANET_URUSOR].messageSlot = 0;
+                       systemPlanet[PLANET_URUSOR].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_URUSOR].subject, "5ÀɤÎWEAPCOÊäµë´Ï¤ÎÙ½Êá");
+
+                       systemPlanet[PLANET_DORIM].messageMission = MISN_DORIM;
+                       systemPlanet[PLANET_DORIM].messageSlot = 1;
+                       systemPlanet[PLANET_DORIM].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_DORIM].subject, "WEAPCO¤Î²Ê³Ø¼Ô¤ÎÁܺ÷");
+
+                       systemPlanet[PLANET_ELAMALE].messageMission = MISN_ELAMALE;
+                       systemPlanet[PLANET_ELAMALE].messageSlot = 0;
+                       systemPlanet[PLANET_ELAMALE].faceImage = FS_PHOEBE;
+                       strcpy(systemPlanet[PLANET_ELAMALE].subject, "WEAPCO¤ÎºÎ·¡Á¥¤ÎÇ˲õ");
 
-       for (int i = 0 ; i < 10 ; i++)
-       {
-               if (fscanf(fp, "%d %s %d", &distance, name, &image) < 3)
-               {
-                       printf("Warning: Data for planet %i in \"%s\" is not correctly formatted\n", i, string);
                        break;
-               }
 
-               systemPlanet[i].y = distance;
-               strcpy(systemPlanet[i].name, name);
-               systemPlanet[i].image = shape[image];
-       }
+               case SYSTEM_MORDOR:
+                       strcpy(systemPlanet[PLANET_CLOAKFIGHTER].name, "WEAPCO¤Î·Þ·âÉôÂâ");
 
-       int messageMission;
-       int messageSlot;
-       char face[50];
-       char from[100];
-       char subject[100];
+                       systemPlanet[PLANET_ODEON].y = 15;
+                       strcpy(systemPlanet[PLANET_ODEON].name, "¥ª¥Ç¥ª¥ó");
+                       systemPlanet[PLANET_ODEON].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_FELLON].y = 30;
+                       strcpy(systemPlanet[PLANET_FELLON].name, "¥Õ¥§¥í¥ó");
+                       systemPlanet[PLANET_FELLON].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_SIVEDI].y = 30;
+                       strcpy(systemPlanet[PLANET_SIVEDI].name, "¥µ¥¤¥Ù¥¸");
+                       systemPlanet[PLANET_SIVEDI].image = gfx_sprites[SP_PLANET_RED];
+
+                       systemPlanet[PLANET_ALMARTHA].y = 20;
+                       strcpy(systemPlanet[PLANET_ALMARTHA].name, "¥¢¥ë¥Þ¥µ");
+                       systemPlanet[PLANET_ALMARTHA].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_POSWIC].y = 20;
+                       strcpy(systemPlanet[PLANET_POSWIC].name, "¥Ý¥¹¥¤¥Ã¥¯");
+                       systemPlanet[PLANET_POSWIC].image = gfx_sprites[SP_PLANET_ORANGE];
+
+                       systemPlanet[PLANET_ELLESH].y = 40;
+                       strcpy(systemPlanet[PLANET_ELLESH].name, "¥¨¥ê¥Ã¥·¥å");
+                       systemPlanet[PLANET_ELLESH].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_CLOAKFIGHTER].messageMission = MISN_CLOAKFIGHTER;
+                       systemPlanet[PLANET_CLOAKFIGHTER].messageSlot = 0;
+                       systemPlanet[PLANET_CLOAKFIGHTER].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_CLOAKFIGHTER].subject, "»îºîÀïÆ®µ¡¤ÎÇ˲õ");
+
+                       systemPlanet[PLANET_ODEON].messageMission = MISN_ODEON;
+                       systemPlanet[PLANET_ODEON].messageSlot = 1;
+                       systemPlanet[PLANET_ODEON].faceImage = FS_PHOEBE;
+                       strcpy(systemPlanet[PLANET_ODEON].subject, "¥¦¡¼¥·¥å¥é¤Îµß½Ð");
+
+                       systemPlanet[PLANET_FELLON].messageMission = MISN_FELLON;
+                       systemPlanet[PLANET_FELLON].messageSlot = 2;
+                       systemPlanet[PLANET_FELLON].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_FELLON].subject, "È¿Í𷳤λٱç");
+
+                       systemPlanet[PLANET_SIVEDI].messageMission = MISN_SIVEDI;
+                       systemPlanet[PLANET_SIVEDI].messageSlot = 0;
+                       systemPlanet[PLANET_SIVEDI].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_SIVEDI].subject, "¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ç¤ÎºÎ·¡");
+
+                       systemPlanet[PLANET_ALMARTHA].messageMission = MISN_ALMARTHA;
+                       systemPlanet[PLANET_ALMARTHA].messageSlot = 1;
+                       systemPlanet[PLANET_ALMARTHA].faceImage = FS_KRASS;
+                       strcpy(systemPlanet[PLANET_ALMARTHA].subject, "Âå¶â¤ÎÍÑ°Õ");
+
+                       systemPlanet[PLANET_POSWIC].messageMission = MISN_POSWIC;
+                       systemPlanet[PLANET_POSWIC].messageSlot = 0;
+                       systemPlanet[PLANET_POSWIC].faceImage = FS_URSULA;
+                       strcpy(systemPlanet[PLANET_POSWIC].subject, "WEAPCO¤Î½ÅÌò¤ÎÈÂÁ÷¤ÎÁË»ß");
+
+                       systemPlanet[PLANET_ELLESH].messageMission = MISN_ELLESH;
+                       systemPlanet[PLANET_ELLESH].messageSlot = 0;
+                       systemPlanet[PLANET_ELLESH].faceImage = FS_PHOEBE;
+                       strcpy(systemPlanet[PLANET_ELLESH].subject, "WEAPCO¤Î½ÅÌò¤ÎÄÉÀ×");
 
-       for (int i = 0 ; i < 10 ; i++)
-       {
-               if ((fscanf(fp, "%d %d %s%*c", &messageMission, &messageSlot, face) < 3) ||
-                       (fscanf(fp, "%[^\n]%*c", from) < 1) ||
-                       (fscanf(fp, "%[^\n]%*c", subject) < 1))
-               {
-                       printf("Warning: Mission data for planet %i in \"%s\" is not correctly formatted\n", i, string);
                        break;
-               }
 
-               systemPlanet[i].messageMission = messageMission;
-               systemPlanet[i].messageSlot = messageSlot;
-               systemPlanet[i].faceImage = getFace(face);
+               case SYSTEM_SOL:
+                       systemPlanet[PLANET_MERCURY].y = 15;
+                       strcpy(systemPlanet[PLANET_MERCURY].name, "¿åÀ±");
+                       systemPlanet[PLANET_MERCURY].image = gfx_sprites[SP_PLANET_RED];
+
+                       systemPlanet[PLANET_VENUS].y = 20;
+                       strcpy(systemPlanet[PLANET_VENUS].name, "¶âÀ±");
+                       systemPlanet[PLANET_VENUS].image = gfx_sprites[SP_PLANET_ORANGE];
+
+                       systemPlanet[PLANET_EARTH].y = 20;
+                       strcpy(systemPlanet[PLANET_EARTH].name, "Ãϵå");
+                       systemPlanet[PLANET_EARTH].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_MARS].y = 20;
+                       strcpy(systemPlanet[PLANET_MARS].name, "²ÐÀ±");
+                       systemPlanet[PLANET_MARS].image = gfx_sprites[SP_PLANET_RED];
+
+                       systemPlanet[PLANET_JUPITER].y = 30;
+                       strcpy(systemPlanet[PLANET_JUPITER].name, "ÌÚÀ±");
+                       systemPlanet[PLANET_JUPITER].image = gfx_sprites[SP_PLANET_ORANGE];
+
+                       systemPlanet[PLANET_SATURN].y = 20;
+                       strcpy(systemPlanet[PLANET_SATURN].name, "ÅÚÀ±");
+                       systemPlanet[PLANET_SATURN].image = gfx_sprites[SP_PLANET_GREEN];
+
+                       systemPlanet[PLANET_URANUS].y = 20;
+                       strcpy(systemPlanet[PLANET_URANUS].name, "Å·²¦À±");
+                       systemPlanet[PLANET_URANUS].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_NEPTUNE].y = 20;
+                       strcpy(systemPlanet[PLANET_NEPTUNE].name, "³¤²¦À±");
+                       systemPlanet[PLANET_NEPTUNE].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_PLUTO].y = 20;
+                       strcpy(systemPlanet[PLANET_PLUTO].name, "̽²¦À±");
+                       systemPlanet[PLANET_PLUTO].image = gfx_sprites[SP_PLANET_BLUE];
+
+                       systemPlanet[PLANET_PLUTO].messageMission = MISN_PLUTO;
+                       systemPlanet[PLANET_PLUTO].messageSlot = 0;
+                       systemPlanet[PLANET_PLUTO].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_PLUTO].subject, "̽²¦À±¤ÎÀ©°µ");
+
+                       systemPlanet[PLANET_NEPTUNE].messageMission = MISN_NEPTUNE;
+                       systemPlanet[PLANET_NEPTUNE].messageSlot = 1;
+                       systemPlanet[PLANET_NEPTUNE].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_NEPTUNE].subject, "³¤²¦À±¤ÎÀ©°µ");
+
+                       systemPlanet[PLANET_URANUS].messageMission = MISN_URANUS;
+                       systemPlanet[PLANET_URANUS].messageSlot = 2;
+                       systemPlanet[PLANET_URANUS].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_URANUS].subject, "Å·²¦À±¤ÎÀ©°µ");
+
+                       systemPlanet[PLANET_SATURN].messageMission = MISN_SATURN;
+                       systemPlanet[PLANET_SATURN].messageSlot = 0;
+                       systemPlanet[PLANET_SATURN].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_SATURN].subject, "³°ÏÇÀ±Ëɱҥ·¥¹¥Æ¥à¤ÎÇ˲õ");
+
+                       systemPlanet[PLANET_JUPITER].messageMission = MISN_JUPITER;
+                       systemPlanet[PLANET_JUPITER].messageSlot = 0;
+                       systemPlanet[PLANET_JUPITER].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_JUPITER].subject, "µßÆñ¿®¹æ¤ÎÄ´ºº");
+
+                       systemPlanet[PLANET_MARS].messageMission = MISN_MARS;
+                       systemPlanet[PLANET_MARS].messageSlot = 0;
+                       systemPlanet[PLANET_MARS].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_MARS].subject, "¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Î¹Ò¹Ô");
+
+                       systemPlanet[PLANET_EARTH].messageMission = MISN_EARTH;
+                       systemPlanet[PLANET_EARTH].messageSlot = 0;
+                       systemPlanet[PLANET_EARTH].faceImage = FS_CHRIS;
+                       strcpy(systemPlanet[PLANET_EARTH].subject, "Ãϵå¤ÎÃ¥´Ô");
+
+                       systemPlanet[PLANET_VENUS].messageMission = MISN_VENUS;
+                       systemPlanet[PLANET_VENUS].messageSlot = 0;
+                       systemPlanet[PLANET_VENUS].faceImage = FS_SID;
+                       strcpy(systemPlanet[PLANET_VENUS].subject, "Á´¤Æ¤ò½ª¤ï¤é¤»¤ë");
 
-               strcpy(systemPlanet[i].from, from);
-               strcpy(systemPlanet[i].subject, subject);
+                       break;
        }
-
-       fclose(fp);
 }
 
 /*
@@ -242,19 +406,19 @@ will show their name and their current status
 static bool intermission_showSystem(float x, float y, bool selectable)
 {
        SDL_Rect r;
-       signed char planet = 0;
+       int planet = 0;
        int planetSpace = systemPlanet[planet].y;
        bool rtn = false;
 
        // Blit the sun
-       blit(shape[30], 370, 220);
+       screen_blit(gfx_sprites[SP_SUN], 370, 220);
 
        for (int i = 50 ; i < 300 ; i+= planetSpace)
        {
                x *= 0.75;
                y *= 0.75;
 
-               circle(400, 250, i, screen, darkGrey);
+               gfx_drawCircle(400, 250, i, screen, darkGrey);
 
                r.x = int(400 + (sinf(x) * i));
                r.y = int(250 + (cosf(y) * i));
@@ -263,30 +427,18 @@ static bool intermission_showSystem(float x, float y, bool selectable)
 
                r.x -= (systemPlanet[planet].image->w / 2);
                r.y -= (systemPlanet[planet].image->h / 2);
-               blit(systemPlanet[planet].image, r.x, r.y);
+               screen_blit(systemPlanet[planet].image, r.x, r.y);
 
                if (selectable &&
-                       collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
+                       game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
                                r.x, r.y, systemPlanet[planet].image->w,
                                systemPlanet[planet].image->h))
                {
-                       drawString(systemPlanet[planet].name, -1, 545, FONT_WHITE);
+                       screen_renderString(systemPlanet[planet].name, -1, 545, FONT_WHITE);
                        if ((engine.keyState[KEY_FIRE]))
                        {
-                               if (game.system == 0)
-                               {
-                                       game.stationedPlanet = planet;
-                                       game.destinationPlanet = planet;
-                                       game.area = systemPlanet[game.stationedPlanet].missionNumber;
-                                       strcpy(game.stationedName, systemPlanet[game.stationedPlanet].name);
-                                       saveGame(0);
-                               }
-                               else
-                               {
-                                       game.destinationPlanet = planet;
-                                       strcpy(game.destinationName, systemPlanet[game.destinationPlanet].name);
-                               }
-
+                               game.destinationPlanet = planet;
+                               strcpy(game.destinationName, systemPlanet[game.destinationPlanet].name);
                                rtn = true;
                                engine.keyState[KEY_FIRE] = 0;
                        }
@@ -309,6 +461,7 @@ list is reset and the information lines begin again from the bottom
 */
 static void intermission_showStatus(SDL_Surface *infoSurface)
 {
+       int y;
        float speed = 0.25;
 
        if(engine.keyState[KEY_DOWN])
@@ -316,86 +469,95 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
        else if(engine.keyState[KEY_UP])
                speed = -1;
 
-       blit(infoSurface, 100, 80);
+       screen_blit(infoSurface, 100, 80);
 
-       for (int i = 0 ; i < 22 ; i++)
+       for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
        {
-               textShape[i].y -= speed;
-               if ((textShape[i].y > 80) && (textShape[i].y < 400))
-                       blitText(i);
+               gfx_textSprites[i].y -= speed;
+               if ((gfx_textSprites[i].y > 80) && (gfx_textSprites[i].y < 400))
+                       screen_blitText(i);
        }
 
-       if (textShape[21].y < 65)
+       if (gfx_textSprites[TS_STATUS_FOOTER - 1].y < 65)
        {
-               textShape[0].y = 400;
-
-               for (int i = 1 ; i < 25 ; i++)
+               y = 400;
+               for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
                {
-                       textShape[i].y = textShape[i - 1].y + 20;
-                       if ((i == 7) || (i == 16) || (i == 19))
-                               textShape[i].y += 25;
+                       y += 20;
+                       if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
+                                       (i == TS_URSULA_HEADER))
+                               y += 25;
+
+                       gfx_textSprites[i].y = y;
                }
        }
 
-       blevelRect(100, 80, 600, 20, 0x00, 0x00, 0x99);
+       screen_drawRect(100, 80, 600, 20, 0x00, 0x00, 0x99);
 
-       blevelRect(100, 400, 600, 20, 0x00, 0x00, 0x99);
+       screen_drawRect(100, 400, 600, 20, 0x00, 0x00, 0x99);
 
-       blitText(26);
-       blitText(27);
+       screen_blitText(TS_STATUS_HEADER);
+       screen_blitText(TS_STATUS_FOOTER);
 }
 
 static void intermission_updateCommsSurface(SDL_Surface *comms)
 {
+       char string[255];
+
        if (engine.commsSection == 1)
                return;
 
-       char string[255];
-
-       blevelRect(comms, 0, 10, comms->w - 1, 55, 0x00, 0x22, 0x00);
-       blit(shape[FACE_CHRIS], 20, 15, comms);
-       drawString("¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É", 80, 15, FONT_WHITE, comms);
+       gfx_drawRect(comms, 0, 10, comms->w - 1, 55, 0x00, 0x22, 0x00);
+       gfx_blit(gfx_faceSprites[FS_CHRIS], 20, 15, comms);
+       gfx_renderString("¥¯¥ê¥¹¡¦¥Ð¥ó¥Õ¥£¡¼¥ë¥É", 80, 15, FONT_WHITE, 0, comms);
        sprintf(string, "¸½ºß°ÌÃÖ: %s", systemPlanet[game.stationedPlanet].name);
-       drawString(string, 80, 35, FONT_WHITE, comms);
+       gfx_renderString(string, 80, 35, FONT_WHITE, 0, comms);
 }
 
 static void intermission_createCommsSurface(SDL_Surface *comms)
 {
        engine.commsSection = 0;
 
-       blevelRect(comms, 0, 0, comms->w - 1, comms->h - 1, 0x00, 0x00, 0x25);
+       gfx_drawRect(comms, 0, 0, comms->w - 1, comms->h - 1, 0x00, 0x00, 0x25);
 
-       drawString("+++ ¼õ¿®¤·¤¿¥á¥Ã¥»¡¼¥¸ +++", 115, 80, FONT_GREEN, comms);
+       gfx_renderString("+++ ¸½ºß¤ÎºîÀï (¥¯¥ê¥Ã¥¯¤Ç¾ÜºÙ¤òɽ¼¨) +++", -1, 80, FONT_GREEN, 0, comms);
 
        int yOffset;
 
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
        {
                if ((systemPlanet[i].messageSlot != -1) && (systemPlanet[i].missionCompleted == 0))
                {
                        yOffset = systemPlanet[i].messageSlot * 60;
-                       blevelRect(comms, 0, 105 + yOffset, comms->w - 1, 55, 0x00, 0x00, 0x77);
-                       blit(shape[systemPlanet[i].faceImage], 20, 110 + yOffset, comms);
-                       drawString(systemPlanet[i].from, 80, 110 + yOffset, FONT_WHITE, comms);
-                       drawString(systemPlanet[i].subject, 80, 130 + yOffset, FONT_CYAN, comms);
-                       drawString("INCOMPLETE", 350, 110 + yOffset, FONT_RED, comms);
+                       gfx_drawRect(comms, 0, 105 + yOffset, comms->w - 1, 55, 0x00, 0x00, 0x77);
+                       gfx_blit(gfx_faceSprites[systemPlanet[i].faceImage], 20, 110 + yOffset, comms);
+                       gfx_renderString(systemPlanet[i].name, 80, 110 + yOffset, FONT_WHITE, 0, comms);
+                       gfx_renderString(systemPlanet[i].subject, 80, 130 + yOffset, FONT_CYAN, 0, comms);
                }
        }
 
        intermission_updateCommsSurface(comms);
 }
 
+static int intermission_renderDialog(SDL_Surface *comms, int y, int face, const char *string)
+{
+       int newY;
+       gfx_blit(gfx_faceSprites[face], 10, y, comms);
+       newY = gfx_renderString(string, 80, y, FONT_WHITE, 1, comms) + 25;
+       if (newY < y + 60)
+               newY += (60 - (newY - y));
+       return newY;
+}
+
 static void intermission_createMissionDetailSurface(SDL_Surface *comms, int missionSlot)
 {
        char name[50];
        char string[2000];
        int y = 50;
-       int newY = y;
-       int col = FONT_WHITE;
        int mission = -1;
-       int faceNumber = -1;
-       FILE *fp;
 
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
        {
                if ((systemPlanet[i].messageSlot == missionSlot) && (systemPlanet[i].missionCompleted == 0))
@@ -407,41 +569,390 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
        if (mission == -1)
                return;
 
-       blevelRect(comms, 0, 0, comms->w - 1, comms->h - 1, 0x00, 0x00, 0x25);
+       gfx_drawRect(comms, 0, 0, comms->w - 1, comms->h - 1, 0x00, 0x00, 0x25);
+
+       // XXX: The "name" should correspond with whatever name was presented in
+       // the screen listing all of the comms. For some reason, this has always
+       // been defined twice, which is redundant and has led to inconsistencies in
+       // the past.
+       switch (mission)
+       {
+               case MISN_HAIL:
+                       strcpy(name, "¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼");
 
-       sprintf(string, "data/brief%d.txt", mission);
+                       strcpy(string, "¤ª¤¤¡¢¾®ÁÎ! ¤ªÁ°¤Î¤¿¤á¤ËÅð¤ó¤Ç¤ä¤Ã¤¿¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ÎÂå¶â¤¬¤Þ¤À¤À¤¾! ¤À¤¬¡¢¤½¤ÎÂå¤ï¤ê¤ËWEAPCO¤Î·±Îý¾ì¤Ø¹Ô¤Ã¤Æ¡¢¤½¤³¤ÇÁ´¤Æ¤Î´Ï¤òÇ˲õ¤·¤Æ¤¯¤ì¡£");
+                       y = intermission_renderDialog(comms, y, FS_KRASS, string);
 
-       fp = fopen(string, "rb");
+                       strcpy(string, "²¿? ¤½¤ì¤Ï²¶¤¬¤ªÁ°¤ËÍê¤ó¤À»Å»ö¤À¤í¤¦?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
 
-       if (fscanf(fp, "%[^\n]%*c", name) < 1)
-       {
-               printf("Warning: Failed to retrieve name from \"%s\"\n", string);
-               strcpy(name, "Error");
-       }
-       sprintf(string, "+++ %s¤È¤Î¸ò¿® +++", name);
-       drawString(string, -1, 20, FONT_GREEN, comms);
+                       strcpy(string, "ʬ¤«¤Ã¤Æ¤¤¤ë¡£¤À¤¬¡¢¤³¤ÎÊýË¡¤Ê¤é¤ªÁ°¤Ï¤¹¤°¤Ë¼Ú¤ê¤òÊÖ¤»¤ë¤¾¡£¤³¤Î»Å»ö¤ò¤·¤Æ¡¢¤µ¤é¤Ë$500²Ô¤¤¤Ç¤³¤¤¡£¤³¤ì¤ÇÄ¢¾Ã¤·¤À¡£¤â¤·¤ªÁ°¤¬»à¤ó¤À¤é¡Ä¤½¤¦¤À¤Ê¡¢¤½¤Î´Ï¤Ë¤ÏÅð¤à¤À¤±¤Î²ÁÃͤ¬¤Ê¤«¤Ã¤¿¤Ã¤Æ¤³¤È¤À! ¥Ï¥Ã¥Ï¥Ã¥Ï¥Ã!");
+                       y = intermission_renderDialog(comms, y, FS_KRASS, string);
 
-       while (fscanf(fp, "%[^\n]%*c", string) == 1)
-       {
-               faceNumber = getFace(string);
-               if (faceNumber > -1)
-               {
-                       blit(shape[faceNumber], 10, y, comms);
-                       col = FONT_WHITE;
-               }
-               else
-               {
-                       newY = drawString(string, 80, y, col, 1, comms) + 25;
-                       if (newY < y + 60)
-                               newY += (60 - (newY - y));
-                       y = newY;
-               }
+                       strcpy(string, "ÁêÊѤï¤é¤º¿Í»È¤¤¤¬¹Ó¤¤¤Ê¡¢¥¯¥é¥¹¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_CERADSE:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¤è¤ª¡¢¥·¥É¡£¤É¤¦¤«¤·¤¿¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¥¯¥ê¥¹¡¢Í¢Á÷´Ï¤¬WEAPCO¤Ë½±¤ï¤ì¤¿¡£¤É¤¦¤ä¤é¥»¥é¥É¥»¤Ë°åÎÅÉʤò±¿¤ó¤Ç¤¤¤¿¤è¤¦¤À¡£Â¿¤¯¤ÎÌ¿¤òµß¤¦¤¿¤á¤ËÀѲ٤ò¼è¤êÌᤵ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤¤¤¯¤Ä¤¢¤ë¤ó¤À?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "Á´Éô¤Ç6¤Ä¤À! ¤â¤·1¤Ä¤Ç¤â¼º¤¨¤Ð¡¢¿ô¥ö·î¤ÎÆâ¤Ë¤³¤Î¥¹¥Ô¥ê¥Ã¥È·Ï¤Î¿Í¡¹¤¬²¿Àé¿Í¤â»à¤ó¤Ç¤·¤Þ¤¦¤À¤í¤¦¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_HINSTAG:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¤ª¤Ã¤È! ¥ß¥µ¥¤¥ëÄú¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤½¤¦¤À¡£¤É¤¦¤ä¤éWEAPCO¤Ï·¯¤Î¹ÔÆ°¤ËÃíÌܤ·»Ï¤á¤¿¤è¤¦¤À¤Ê¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤ª¤â¤·¤í¤¤! ¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ÎÀïƮǽÎϤΥƥ¹¥È¤Ë¤Ô¤Ã¤¿¤ê¤À!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "µ¤¤ò¤Ä¤±¤í¡¢¥¯¥ê¥¹¡£1ÀɤΥߥµ¥¤¥ëÄú¤Ç¤â¼çÍ×ÅÔ»Ô¤òÇ˲õ¤Ç¤­¤ë¤Û¤É¤Î¥í¥±¥Ã¥È¤òÅëºÜ¤·¤Æ¤¤¤ë¡£ÅÛ¤é¤Ë¤ÏÀµÌ̤«¤é¸þ¤«¤ï¤º¡¢½½Ê¬¤Êµ÷Î¥¤òÊݤơ£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_JOLDAR:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¥¸¥ç¥ë¥À¡¼¼þÊդε¡Íë¤ò½üµî¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£µ¡ÍëÃÏÂӤΤ»¤¤¤ÇÏÇÀ±´Ö¸òÄ̤¬Á˳²¤µ¤ì¤Æ¤¤¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "Âà¶þ¤·¤Î¤®¤Ë¤Ê¤ê¤½¤¦¤ÊÀïÆ®µ¡¤Ï¶á¤¯¤Ë¤¤¤Ê¤¤¤Î¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "º£¤Î½ê¤Ï¤Ê¡£¤À¤¬Åۤ餬°ú¤­´¹¤¨¤·¤Æ¤³¤Ê¤¤¤È¤Ï¸À¤¤ÀÚ¤ì¤Ê¤¤¡£µ¡Íë¤Ë¤Ïµ¤¤ò¤Ä¤±¤í! WEAPCO¤Î¿®¹æ¤òȯ¤·¤Æ¤¤¤Ê¤¤´Ï¤Ï¶á¤Å¤¤¤¿¤À¤±¤ÇÇúȯ¤¹¤ë¡£¼ÙËâ¤Ê¤é¤ÐÂǤÁÍî¤È¤»¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_MOEBO:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¶ÛµÞ»öÂÖ¤À! WEAPCO¤Ï²æ¡¹¤Î³èÆ°¤ò»ß¤á¤ë¤¿¤á¤Ë¥¹¥Ô¥ê¥Ã¥È¤òÇ˲õ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë! ¤½¤ÎÇúȯ¤ÏÀ±·Ï¤ÎÁ´¤Æ¤ÎÏÇÀ±¤ò´¬¤­¹þ¤à¤À¤í¤¦! ¥Õ¥ê¥²¡¼¥È¤¬¼ÍÄøÆâ¤ËÆþ¤ëÁ°¤ËÇ˲õ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ÃÜÀ¸¤á! º£¤¹¤°È¯¿Ê¤¹¤ë!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¥¯¥ê¥¹¡¢³§¤¬·¯¤Ë´üÂÔ¤·¤Æ¤¤¤ë! ¤À¤¬Ëº¤ì¤ë¤Ê - ÅÛ¤é¤Ï·è¤·¤Æ¡Ø¥¹¥¿¡¼¥­¥é¡¼¡Ù¤È¤Ï¸Æ¤Ð¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¤½¤ì¤Ç¤Ï¤­¤ì¤¤²á¤®¤ë¤«¤é¤À!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_RESCUESLAVES:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "ÃΤäƤÎÄ̤ꡢ¤³¤ÎÀ±·Ï¤Ë¤Ï¤¿¤¯¤µ¤ó¤ÎWEAPCO¤ÎÅÛÎ줬¤¤¤ë¡£Èà¤é¤ò²òÊü¤Ç¤­¤ì¤ÐÈ¿·â¤Î¤­¤Ã¤«¤±¤Ë¤Ê¤ë¤Ï¤º¤À¡£ÊѲ½¤¬¸½¤ì¤ë¤¿¤á¤Ë¤Ï¡¢250¿Í¤Ïµß½Ð¤¹¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤Û¤È¤ó¤É¤ÎÅÛÎì¤ÏºÎ·¡¤ò¤·¤Æ¤¤¤ë¤½¤¦¤À¤Ê¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤½¤¦¤À¡£¤À¤¬¡¢ºÎ·¡½ê¤òľÀܹ¶·â¤¹¤ë¤Î¤Ï´í¸±¤À¡£ÅÛÎì¤ÎÈÂÆþ¤òÁ˻ߤ¹¤ë¤Î¤¬¤¤¤¤¤À¤í¤¦¡£¤¢¤¿¤ê¤òÈô¹Ô¤·¡¢WEAPCO¤Î¥Ñ¥È¥í¡¼¥ë¤ò·Þ·â¤·¤í¡£¤â¤Á¤í¤óÅÛÎìÁ¥¤ò¸î±Ò¤·¤Æ¤¤¤ë¤È¤Ï¸Â¤é¤Ê¤¤¡£½½Ê¬¤Ëµ¤¤ò¤Ä¤±¤í!!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_NEROD:
+                       strcpy(name, "¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹");
+
+                       strcpy(string, "½õ¤±¤Æ! SOS! Ã¯¤«Ê¹¤³¤¨¤Æ¤ë?!");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "¤è¤¯Ê¹¤³¤¨¤ë¤¾! ¤É¤¦¤·¤¿?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤¢¤¢¡¢½õ¤«¤Ã¤¿¤ï! ¥Í¥í¥É¼þÊÕ¤ÇWEAPCO¤ÎÂç·³¤Ë°Ï¤Þ¤ì¤Æ¤¤¤ë¤Î! »Ù±ç¤ò!");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "¤¹¤°¸þ¤«¤¦!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_ALLEZ:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "º£¡¢Ê̤ÎSOS¤ò¼õ¿®¤·¤¿¡£½ÅÍפʰåÌôÉʤò±¿¤ÖÍ¢Á÷´Ï¤«¤é¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ʬ¤«¤Ã¤¿¡£¤¹¤°¸þ¤«¤¦¤ÈÅÁ¤¨¤Æ¤¯¤ì¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_URUSOR:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¤³¤ÎÀ±·Ï¤òÎ¥¤ì¤ëÁ°¤Ë¤¤¤¯¤é¤«»ñ¸»¤ò³ÎÊݤ¹¤ëɬÍפ¬¤¢¤ë¡£¤½¤ì¤¬¤¢¤ì¤Ð¥â¥ë¥É¡¼¥ë·Ï¤Ç¤Î³èÆ°¤¬¤è¤ê´Êñ¤Ë¤Ê¤ë¤À¤í¤¦¡£ÌäÂê¤Ï¡¢¤³¤Î¤¢¤¿¤ê¤Ç¤ÏWEAPCO¤·¤«»ý¤Ã¤Æ¤Ê¤¤¤³¤È¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤½¤ì¤Ç¤É¤³¤Ø¹Ô¤±¤Ð¼ê¤ËÆþ¤ë¤ó¤À?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¶á¤¯¤Ë¤½¤ÎÂç·¿Êäµë´Ï¤¬¤¤¤ë¡£»ä¤¬¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¡£·¯¤Ë¤Ï¤½¤Î´Ö¤Î±ç¸î¤ò¤¿¤Î¤à¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ʬ¤«¤Ã¤¿!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_DORIM:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "WEAPCO¤Î²Ê³Ø¼Ô¤¬¥Ý¥Ã¥É¤ÇæÁö¤·¡¢¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ë±£¤ì¤Æ¤¤¤ë¤é¤·¤¤¡£µß½Ð¤Ç¤­¤ì¤Ð¥â¥ë¥É¡¼¥ë·Ï¤Î¾ðÊó¤òʹ¤±¤ë¤«¤â¤·¤ì¤Ê¤¤¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤¹¤°¹Ô¤³¤¦¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_ELAMALE:
+                       strcpy(name, "¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹");
+
+                       strcpy(string, "²æ¡¹¤¬µß½Ð¤·¤¿ÅÛÎ줿¤Á¤¬È¿Íð¤òµ¯¤³¤·¤¿¤È¤Î¾ðÊó¤¬Æþ¤Ã¤¿¡£·×²è¤Ï¤¦¤Þ¤¯¿Ê¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "WEAPCO¤Î̵¿ÍºÎ·¡Á¥¤¬¥¨¥é¥á¡¼¥ë¤Îµ°Æ»¾å¤Ë¤¢¤ë¤ï¡£¤³¤ì¤òÇ˲õ¤·¤Æ³ÉÍ𤹤ë¤Î¤Ï¤É¤¦?");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "¤¤¤¤¥¢¥¤¥Ç¥¢¤À!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤½¤ì¤Ï¤¦¤Þ¤¯¹Ô¤¯¤À¤í¤¦¡£¤À¤¬ÌýÃǤ¹¤ë¤Ê¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_CLOAKFIGHTER:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "»îºîÀïÆ®µ¡¤Î¤³¤È¤Ï²¿¤«Ê¬¤«¤Ã¤¿¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¥ì¡¼¥À¡¼¤Ë±Ç¤é¤Ê¤¤¼×ÊÃÁõÃ֤ΰì¼ï¤òÅëºÜ¤·¤Æ¤¤¤ë¡£ÄÉÀפϺ¤Æñ¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¶öÁ³½Ð²ñ¤¦¤Þ¤ÇÈô¤Ó²ó¤ë¤·¤«¤Ê¤¤¤Ê¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤¿¤È¤¨Áø¶ø¤·¤Æ¤âÁê¼ê¤Ïƨ¤²¤ë¤À¤í¤¦¡£¸«¤Ä¤±¤¿¤é²Äǽ¤Ê¸Â¤ê¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤³¤È¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_ODEON:
+                       strcpy(name, "¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹");
+
+                       strcpy(string, "»Ð¤µ¤ó¤Î´Ï¤ò¥ª¥Ç¥ª¥ó¤Îµ°Æ»¾å¤Ç¸«¤Ä¤±¤¿¡£¤Ç¤â¡¢¤³¤Á¤é¤ÎÄÌ¿®¤ò̵»ë¤·¤Æ¤¤¤ë¤Î¡£");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "·ù¤Êͽ´¶¤¬¤¹¤ë¤Ê¡£Èà½÷¤ÏWEAPCO¤Î½¸ÃĤÎÃæ¤ò¼«Í³¤Ë°ÜÆ°¤·¤Æ¤¤¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¿²Ê֤俤Τ«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤¢¤ê¤¨¤Ê¤¤¡£WEAPCO¤ò¤È¤Æ¤âÁþ¤ó¤Ç¤¤¤¿¤â¤Î¡£");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "¥Þ¥¤¥ó¥É¥³¥ó¥È¥í¡¼¥ë¤Î°ì¼ï¤«¤â¤·¤ì¤Ê¤¤¡£WEAPCO¤¬ºÇ¶á¿·¤·¤¤¡ÖAI¥È¥ì¡¼¥Ë¥ó¥°¥×¥í¥°¥é¥à¡×¤ò³«È¯Ãæ¤À¤Èʹ¤¤¤¿¡£Á᤯½õ¤±¤¿¤Û¤¦¤¬Îɤ¤¤Ê!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_FELLON:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "È¿Í𷳤ˤè¤ë¹¶·â¤Î·×²è¤¬¤¢¤ë¡£Èà¤é¤ò»Ù±ç¤·¾¡Íø¤Ç¤­¤ì¤Ð¡¢»Îµ¤¤ÏÂ礤¤Ë¹â¤Þ¤ë¤À¤í¤¦¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤¹¤²¤¨! ¤¹¤°½Ð·â¤À!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "È¿Í𷳤δϤ¬Á´¤ÆÇ˲õ¤µ¤ì¤ë¤³¤È¤À¤±¤ÏÈò¤±¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_SIVEDI:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "WEAPCO¤ÎºÎ·¡Á¥¤«¤éÃ¥¤¦¤Î¤Ï¡¢¤¢¤Þ¤ê¤è¤¤ÊýË¡¤Ç¤Ï¤Ê¤«¤Ã¤¿¡£¤À¤¬¡¢¤¢¤Î¥¢¥¹¥Æ¥í¥¤¥É¤Î¹ÛÀФÏÉð´ï¤ÎÀ¸»º¤ËɬÍפÀ¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤ª¤¤¤ª¤¤! ¤Ä¤Þ¤ê¡¢²¶¤Ë¼è¤ê¤Ë¹Ô¤±¤È¸À¤Ã¤Æ¤¤¤ë¤Î¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤½¤ÎÄ̤ê¤À¡£Ãí°Õ¤·¤í¡¢¥¯¥ê¥¹¡£·¯¤ÎÉð´ï¤Ï¤½¤Î¤è¤¦¤Êºî¶È¤Î¤¿¤á¤ËÀ߷פµ¤ì¤Æ¤¤¤Ê¤¤¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               case MISN_ALMARTHA:
+                       strcpy(name, "¥¯¥é¥¹¡¦¥¿¥¤¥é¡¼");
+
+                       strcpy(string, "¤ª¤¤¥¯¥é¥¹! ¼êÅÁ¤Ã¤Æ¤¯¤ì¡£¥Õ¥§¡¼¥Ù¤È¥¦¡¼¥·¥å¥é¤¬WEAPCO¤Î½ÅÍפʥץé¥ó¥È¤òÇ˲õ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£¤Á¤ç¤Ã¤ÈÁû¤®¤òµ¯¤³¤·¤Æ¡¢¤³¤Á¤é¤ËÃí°Õ¤ò°ú¤­ÉÕ¤±¤é¤ì¤Ê¤¤¤«?");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "¤¤¤¤¤¾¡¢¾®ÁΡ£½õ¤±¤Æ¤ä¤í¤¦¡£¤À¤¬¡¢¶â¤À¡Ä");
+                       y = intermission_renderDialog(comms, y, FS_KRASS, string);
+
+                       break;
+
+               case MISN_POSWIC:
+                       strcpy(name, "¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹");
+
+                       strcpy(string, "µ­²±¤¬´°Á´¤ËÌá¤Ã¤¿¡£¤½¤³¤Ç¤ÏÌÌÇò¤¤¤³¤È¤¬¹Ô¤ï¤ì¤Æ¤¤¤¿¤¾¡£»ä¤¬Êá¤é¤¨¤é¤ì¤ëľÁ°¡¢WEAPCO¤¬²¿¿Í¤â¤Î½ÅÌò¤ò¥Ý¥¹¥¤¥Ã¥¯¤Ë°ÜÁ÷¤¹¤ë¤Î¤ò¸«¤¿¡£");
+                       y = intermission_renderDialog(comms, y, FS_URSULA, string);
+
+                       strcpy(string, "¤½¤Î¤è¤¦¤Ê¥Á¥ã¥ó¥¹¤ò¸«Æ¨¤¹¤ï¤±¤Ë¤Ï¤¤¤«¤Ê¤¤! »ä¤â¤½¤Î´Ï¤ò¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¤¿¤á¤Ë»²²Ã¤¹¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "Íê¤à¤¾!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_ELLESH:
+                       strcpy(name, "¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹");
+
+                       strcpy(string, "¥Õ¥§¡¼¥Ù¡¢¤ªÁ°¤Ï¤³¤³¤ò¸«Ä¥¤Ã¤Æ¤Æ¤¯¤ì¡£²¶¤Ï¤¢¤Î´Ï¤òÄɤ¦!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "Äɤ¤¤Ä¤±¤ë¤È»×¤Ã¤Æ¤ë¤Î?");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "¤â¤Á¤í¤ó¤À¡£¤³¤Î¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤Î¥¹¥Ô¡¼¥É¤¬¤¢¤ì¤Ð¤Ê¡£¤¹¤°¤Ë¸«¤»¤Æ¤ä¤ë¤è!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_PLUTO:
+               case MISN_NEPTUNE:
+               case MISN_URANUS:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¤Þ¤º³°ÏÇÀ±¤òÀ©°µ¤·¡¢¤½¤³¤«¤éÀÚ¤ê¹þ¤à¡£¤½¤¦¤¹¤ì¤ÐºÇ¸å¤ÎºîÀï¤Î¤È¤­Î¾Â¦¤«¤é¶´¤Þ¤ì¤ë´í¸±À­¤¬¾®¤µ¤¯¤Ê¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ʬ¤«¤Ã¤¿¡£");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "OK");
+                       y = intermission_renderDialog(comms, y, FS_URSULA, string);
+
+                       strcpy(string, "λ²ò¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_SATURN:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "WEAPCO¤ÏÅÚÀ±¤ÈÅ·²¦À±¤Î´Ö¤Ë¹âÅÙ¤ÊËɱҥ饤¥ó¤ò°ú¤¤¤Æ¤¤¤ë¡£¤³¤ì¤ò¼è¤ê½ü¤¯É¬Íפ¬¤¢¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤É¤Î¤è¤¦¤ÊËɱҥ·¥¹¥Æ¥à¤Ê¤Î¤À?");
+                       y = intermission_renderDialog(comms, y, FS_URSULA, string);
+
+                       strcpy(string, "¾®·¿¤ÎÊ£¿ô¤Î°ÜÆ°¤Ç¤­¤ë¥ì¡¼¥¶¡¼Ë¤¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¡£¤«¤Ä¤Æ¥¹¥Ô¥ê¥Ã¥È·Ï¤ÇÀï¤Ã¤¿¥¹¥¿¡¼¥­¥é¡¼¤È¤ÏÁ´¤¯°Û¤Ê¤ë¼ïÎà¤Îʼ´ï¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¤Ê¤é¤Ð¡¢»ä¤Î¥ß¥µ¥¤¥ë¥é¥ó¥Á¥ã¡¼¤ò¤è¤¯ÅÀ¸¡¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Í!");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       break;
+
+               case MISN_JUPITER:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "³§¤¬¤¤¤Ê¤¤´Ö¤Ë¡¢ÌÚÀ±¼þÊÕ¤«¤éµßÆñ¿®¹æ¤ò¼õ¿®¤·¤¿¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ÂÀÍÛ·ÏÆâ¤Î郎¿®¹æ¤òÁ÷¤ëɬÍפ¬¤¢¤ë¤Î¤À?");
+                       y = intermission_renderDialog(comms, y, FS_URSULA, string);
+
+                       strcpy(string, "Ä´¤Ù¤Æ¤ß¤è¤¦¡£æ«¤«¤â¤·¤ì¤ó¤¬¡¢²¿¤È¤«¤Ê¤ë¤µ¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_MARS:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¥¯¥ê¥¹¡¢¾¯¤·ÌäÂ꤬¤¢¤ë¡£WEAPCO¤Ï¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤Ëµ¡Í븶¤òÉߤ¤¤Æ¤¤¤ë¡£¤³¤ì¤ò¼è¤ê½ü¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "ʬ¤«¤Ã¤¿¡£°ÂÁ´¤ÊÆ»¤òºî¤ì¤¿¤éÏ¢Íí¤¹¤ë¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       break;
+
+               case MISN_EARTH:
+                       strcpy(name, "Á´°÷");
+
+                       strcpy(string, "¤è¤·¤ß¤ó¤Ê¡¢¤¤¤è¤¤¤è¤À¡£²¶¤¿¤Á¤Ï¶ì¤·¤¤Ãæ¤ò¤º¤Ã¤È¿Ê¤ó¤Ç¤­¤¿¡£Âफ¤ºÁ´¤Æ¤ÎÎϤÇÅÛ¤é¤ò᤯¤·¤«¤Ê¤¤!");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "°ú¤­ÊÖ¤¹¤Ë¤Ï±ó¤¹¤®¤ë½ê¤Þ¤ÇÍè¤Æ¤·¤Þ¤Ã¤¿¡£Á´°÷À¸¤­¤Æµ¢¤ë¤ó¤À!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       strcpy(string, "¹Ô¤­¤Þ¤·¤ç¤¦¡¢¥¯¥ê¥¹¡£");
+                       y = intermission_renderDialog(comms, y, FS_PHOEBE, string);
+
+                       strcpy(string, "WEAPCO¤Ë»ä¤ÎƬ¤òÁà¤Ã¤¿¤³¤È¤ò¸å²ù¤µ¤»¤Æ¤ä¤ë!");
+                       y = intermission_renderDialog(comms, y, FS_URSULA, string);
+
+                       break;
+
+               case MISN_VENUS:
+                       strcpy(name, "¥·¥É¡¦¥¦¥£¥ë¥½¥ó");
+
+                       strcpy(string, "¥±¥¹¥é¥ó¤Ï¶âÀ±¤Øƨ¤²¤¿¡£²¶¤ÏÅÛ¤òÄɤ¦¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "µ¤¤ò¤Ä¤±¤Æ¤¯¤ì¡¢¥¯¥ê¥¹¡£²æ¡¹¤ÏÀïÁè¤Ë¾¡Íø¤·¤¿¡£¤Ê¤Î¤Ë·¯¤Ë»à¤Ê¤ì¤¿¤È¤¢¤Ã¤Æ¤ÏÂѤ¨Æñ¤¤ÃÑ¿«¤À!");
+                       y = intermission_renderDialog(comms, y, FS_SID, string);
+
+                       break;
+
+               default:
+                       strcpy(name, "ï¤â¤¤¤Ê¤¤");
+                       strcpy(string, "¤ª¤¤¡¢²¿¤Ç²¶¤Ï¼«Ê¬¤ËÏ䷤Ƥë¤ó¤À? ¤¢¤ê¤¨¤Ê¤¤! ¤³¤ì¤Ï¥Ð¥°¤À¡£");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       sprintf(string, "starfighter.nongnu.org¤Ø¹Ô¤Ã¤Æ¡¢¤³¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëɬÍפ¬¤¢¤ë¤Ê¡£ºîÀïÈÖ¹æ%d¤ÇÌäÂêȯÀ¸¤À¡£", mission);
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
+
+                       strcpy(string, "ÂԤơ¢²¿¤òÏ䷤Ƥ¤¤ë¤ó¤À? Ã¯¤âʹ¤¤¤Æ¤¤¤Ê¤¤¤Ï¤º¤À¤¬¡Ä");
+                       y = intermission_renderDialog(comms, y, FS_CHRIS, string);
        }
 
-       fclose(fp);
+       sprintf(string, "+++ %s¤È¤Î¸ò¿® +++", name);
+       gfx_renderString(string, -1, 20, FONT_GREEN, 0, comms);
 
-       blevelRect(comms, 5, comms->h - 28, 180, 20, 0x25, 0x00, 0x00);
-       drawString("RETURN TO MESSAGES", 15, comms->h - 25, FONT_WHITE, 1, comms);
+       gfx_drawRect(comms, 5, comms->h - 28, 180, 20, 0x25, 0x00, 0x00);
+       gfx_renderString("RETURN TO MISSIONS", 15, comms->h - 25, FONT_WHITE, 1, comms);
 
        engine.commsSection = 1;
 }
@@ -454,7 +965,7 @@ static void intermission_doComms(SDL_Surface *comms)
                {
                        for (int i = 0 ; i < 4 ; i++)
                        {
-                               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 170, 180 + (i * 60), 430, 50))
+                               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 170, 180 + (i * 60), 430, 50))
                                {
                                        intermission_createMissionDetailSurface(comms, i);
                                        engine.keyState[KEY_FIRE] = 0;
@@ -463,7 +974,7 @@ static void intermission_doComms(SDL_Surface *comms)
                }
                else
                {
-                       if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 170, 440, 160, 20))
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 170, 440, 160, 20))
                        {
                                intermission_createCommsSurface(comms);
                                engine.keyState[KEY_FIRE] = 0;
@@ -476,68 +987,68 @@ static void intermission_createOptions(SDL_Surface *optionsSurface)
 {
        SDL_FillRect(optionsSurface, NULL, black);
 
-       blevelRect(optionsSurface, 0, 0, optionsSurface->w - 2, optionsSurface->h - 2, 0x00, 0x00, 0x44);
+       gfx_drawRect(optionsSurface, 0, 0, optionsSurface->w - 2, optionsSurface->h - 2, 0x00, 0x00, 0x44);
 
-       drawString("++ ¥ª¥×¥·¥ç¥ó ++", 105, 8, FONT_WHITE, optionsSurface);
+       gfx_renderString("++ ¥ª¥×¥·¥ç¥ó ++", 105, 8, FONT_WHITE, 0, optionsSurface);
 
-       blevelRect(optionsSurface, 190, 45, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 250, 45, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 20, 45, 150, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 190, 45, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 250, 45, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 20, 45, 150, 22, 0x00, 0x00, 0x00);
        if (engine.useSound)
-               blevelRect(optionsSurface, 190, 45, 50, 22, 0xff, 0x00, 0x00);
+               gfx_drawRect(optionsSurface, 190, 45, 50, 22, 0xff, 0x00, 0x00);
        else
-               blevelRect(optionsSurface, 250, 45, 50, 22, 0xff, 0x00, 0x00);
-       drawString("ON", 207, 50, FONT_WHITE, optionsSurface);
-       drawString("OFF", 263, 50, FONT_WHITE, optionsSurface);
-       drawString("¸ú²Ì²»", 30, 50, FONT_WHITE, optionsSurface);
-
-       blevelRect(optionsSurface, 190, 95, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 250, 95, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 20, 95, 150, 22, 0x00, 0x00, 0x00);
+               gfx_drawRect(optionsSurface, 250, 45, 50, 22, 0xff, 0x00, 0x00);
+       gfx_renderString("ON", 207, 50, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("OFF", 263, 50, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("¸ú²Ì²»", 30, 50, FONT_WHITE, 0, optionsSurface);
+
+       gfx_drawRect(optionsSurface, 190, 95, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 250, 95, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 20, 95, 150, 22, 0x00, 0x00, 0x00);
        if (engine.useMusic)
-               blevelRect(optionsSurface, 190, 95, 50, 22, 0xff, 0x00, 0x00);
+               gfx_drawRect(optionsSurface, 190, 95, 50, 22, 0xff, 0x00, 0x00);
        else
-               blevelRect(optionsSurface, 250, 95, 50, 22, 0xff, 0x00, 0x00);
-       drawString("ON", 207, 100, FONT_WHITE, optionsSurface);
-       drawString("OFF", 263, 100, FONT_WHITE, optionsSurface);
-       drawString("²»³Ú", 30, 100, FONT_WHITE, optionsSurface);
-
-       blevelRect(optionsSurface, 190, 145, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 250, 145, 50, 22, 0x00, 0x00, 0x00);
-       blevelRect(optionsSurface, 20, 145, 150, 22, 0x00, 0x00, 0x00);
+               gfx_drawRect(optionsSurface, 250, 95, 50, 22, 0xff, 0x00, 0x00);
+       gfx_renderString("ON", 207, 100, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("OFF", 263, 100, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("²»³Ú", 30, 100, FONT_WHITE, 0, optionsSurface);
+
+       gfx_drawRect(optionsSurface, 190, 145, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 250, 145, 50, 22, 0x00, 0x00, 0x00);
+       gfx_drawRect(optionsSurface, 20, 145, 150, 22, 0x00, 0x00, 0x00);
        if (engine.fullScreen)
-               blevelRect(optionsSurface, 190, 145, 50, 22, 0xff, 0x00, 0x00);
+               gfx_drawRect(optionsSurface, 190, 145, 50, 22, 0xff, 0x00, 0x00);
        else
-               blevelRect(optionsSurface, 250, 145, 50, 22, 0xff, 0x00, 0x00);
-       drawString("ON", 207, 150, FONT_WHITE, optionsSurface);
-       drawString("OFF", 263, 150, FONT_WHITE, optionsSurface);
-       drawString("¥Õ¥ë¥¹¥¯¥ê¡¼¥ó", 30, 150, FONT_WHITE, optionsSurface);
+               gfx_drawRect(optionsSurface, 250, 145, 50, 22, 0xff, 0x00, 0x00);
+       gfx_renderString("ON", 207, 150, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("OFF", 263, 150, FONT_WHITE, 0, optionsSurface);
+       gfx_renderString("¥Õ¥ë¥¹¥¯¥ê¡¼¥ó", 30, 150, FONT_WHITE, 0, optionsSurface);
 }
 
 static void intermission_doOptions(SDL_Surface *optionsSurface)
 {
        if ((engine.keyState[KEY_FIRE]))
        {
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 172, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 172, 45, 22))
                        engine.useSound = true;
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 172, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 172, 45, 22))
                        engine.useSound = false;
 
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 222, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 222, 45, 22))
                {
                        engine.useMusic = true;
                        audio_playMusic("music/through_space.ogg", -1);
                }
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 222, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 222, 45, 22))
                {
                        engine.useMusic = false;
                        audio_haltMusic();
                }
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 272, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 417, 272, 45, 22))
                {
                        if (!engine.fullScreen)
                        {
@@ -546,7 +1057,7 @@ static void intermission_doOptions(SDL_Surface *optionsSurface)
                        }
                }
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 272, 45, 22))
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 478, 272, 45, 22))
                {
                        if (engine.fullScreen)
                        {
@@ -567,7 +1078,27 @@ selected an icon.
 */
 int intermission()
 {
-       freeGraphics();
+       int iconInfoY;
+
+       char string[25];
+
+       SDL_Rect r;
+       SDL_Rect destRect;
+       int distance = 0;
+       double interceptionChance;
+
+       int section = 1;
+
+       float sinX = 300;
+       float cosY = 300;
+       bool movePlanets = true;
+       int saveSlot = -1;
+
+       int rtn = 0;
+
+       bool redrawBackground = true;
+
+       gfx_free();
 
        checkForBossMission(); // double check just to make sure!
 
@@ -575,76 +1106,83 @@ int intermission()
        // do not perform certain keyboard actions
        engine.gameSection = SECTION_INTERMISSION;
 
-       clearScreen(black);
-       updateScreen();
-       clearScreen(black);
+       screen_clear(black);
+       renderer_update();
+       screen_clear(black);
 
        initSaveSlots();
 
        loadBackground(systemBackground[game.system]);
 
-       char string[25];
-
        engine.cursor_x = screen->w / 2;
        engine.cursor_y = screen->h / 2;
-       shape[0] = loadImage("gfx/cursor.png");
-
-       // Icons 1 - 29
-       for (int i = 0 ; i < 26 ; i++)
-       {
-               sprintf(string, "gfx/icon%d.png", (i + 1));
-               shape[i + 1] = loadImage(string);
-       }
-
-       shape[27] = loadImage("gfx/buyIcon.png");
-       shape[28] = loadImage("gfx/sellIcon.png");
-       shape[29] = loadImage("gfx/firefly1.png");
+       gfx_sprites[SP_CURSOR] = gfx_loadImage("gfx/cursor.png");
+
+       // Icons
+       gfx_sprites[SP_START_MISSION] = gfx_loadImage("gfx/icon1.png");
+       gfx_sprites[SP_MAP] = gfx_loadImage("gfx/icon2.png");
+       gfx_sprites[SP_STATUS] = gfx_loadImage("gfx/icon3.png");
+       gfx_sprites[SP_SAVE] = gfx_loadImage("gfx/icon4.png");
+       gfx_sprites[SP_SHOP] = gfx_loadImage("gfx/icon5.png");
+       gfx_sprites[SP_COMM] = gfx_loadImage("gfx/icon6.png");
+       gfx_sprites[SP_OPTIONS] = gfx_loadImage("gfx/icon7.png");
+       gfx_sprites[SP_EXIT] = gfx_loadImage("gfx/icon8.png");
+       gfx_sprites[SP_PLASMA_MAX_OUTPUT] = gfx_loadImage("gfx/icon9.png");
+       gfx_sprites[SP_PLASMA_MAX_POWER] = gfx_loadImage("gfx/icon10.png");
+       gfx_sprites[SP_PLASMA_MAX_RATE] = gfx_loadImage("gfx/icon11.png");
+       gfx_sprites[SP_PLASMA_AMMO] = gfx_loadImage("gfx/icon12.png");
+       gfx_sprites[SP_ROCKET_AMMO] = gfx_loadImage("gfx/icon13.png");
+       gfx_sprites[SP_PLASMA_MIN_OUTPUT] = gfx_loadImage("gfx/icon14.png");
+       gfx_sprites[SP_PLASMA_MIN_POWER] = gfx_loadImage("gfx/icon15.png");
+       gfx_sprites[SP_PLASMA_MIN_RATE] = gfx_loadImage("gfx/icon16.png");
+       gfx_sprites[SP_PLASMA_MAX_AMMO] = gfx_loadImage("gfx/icon17.png");
+       gfx_sprites[SP_ROCKET_MAX_AMMO] = gfx_loadImage("gfx/icon18.png");
+       gfx_sprites[SP_DOUBLE_ROCKETS] = gfx_loadImage("gfx/icon19.png");
+       gfx_sprites[SP_MICRO_ROCKETS] = gfx_loadImage("gfx/icon20.png");
+       gfx_sprites[SP_LASER] = gfx_loadImage("gfx/icon21.png");
+       gfx_sprites[SP_HOMING_MISSILE] = gfx_loadImage("gfx/icon22.png");
+       gfx_sprites[SP_CHARGER] = gfx_loadImage("gfx/icon23.png");
+       gfx_sprites[SP_DOUBLE_HOMING_MISSILES] = gfx_loadImage("gfx/icon24.png");
+       gfx_sprites[SP_MICRO_HOMING_MISSILES] = gfx_loadImage("gfx/icon25.png");
+       gfx_sprites[SP_GOTO] = gfx_loadImage("gfx/icon26.png");
+       gfx_sprites[SP_BUY] = gfx_loadImage("gfx/buyIcon.png");
+       gfx_sprites[SP_SELL] = gfx_loadImage("gfx/sellIcon.png");
+       gfx_sprites[SP_FIREFLY] = gfx_loadImage("gfx/firefly1.png");
 
        // Planets 30 - 39
-       shape[30] = loadImage("gfx/planet_sun.png");
-       shape[31] = loadImage("gfx/planet_green.png");
-       shape[32] = loadImage("gfx/planet_blue.png");
-       shape[33] = loadImage("gfx/planet_red.png");
-       shape[34] = loadImage("gfx/planet_orange.png");
-
-       // Faces (as defines)
-       shape[FACE_CHRIS] = loadImage("gfx/face_chris.png");
-       shape[FACE_SID] = loadImage("gfx/face_sid.png");
-       shape[FACE_KRASS] = loadImage("gfx/face_krass.png");
-       shape[FACE_PHOEBE] = loadImage("gfx/face_phoebe.png");
-       shape[FACE_URSULA] = loadImage("gfx/face_ursula.png");
-       shape[FACE_KLINE] = loadImage("gfx/face_kline.png");
+       gfx_sprites[SP_SUN] = gfx_loadImage("gfx/planet_sun.png");
+       gfx_sprites[SP_PLANET_GREEN] = gfx_loadImage("gfx/planet_green.png");
+       gfx_sprites[SP_PLANET_BLUE] = gfx_loadImage("gfx/planet_blue.png");
+       gfx_sprites[SP_PLANET_RED] = gfx_loadImage("gfx/planet_red.png");
+       gfx_sprites[SP_PLANET_ORANGE] = gfx_loadImage("gfx/planet_orange.png");
+
+       // Faces
+       gfx_faceSprites[FS_CHRIS] = gfx_loadImage("gfx/face_chris.png");
+       gfx_faceSprites[FS_SID] = gfx_loadImage("gfx/face_sid.png");
+       gfx_faceSprites[FS_KRASS] = gfx_loadImage("gfx/face_krass.png");
+       gfx_faceSprites[FS_PHOEBE] = gfx_loadImage("gfx/face_phoebe.png");
+       gfx_faceSprites[FS_URSULA] = gfx_loadImage("gfx/face_ursula.png");
+       gfx_faceSprites[FS_KLINE] = gfx_loadImage("gfx/face_kline.png");
+       gfx_faceSprites[FS_CREW] = gfx_loadImage("gfx/face_crew.png");
 
        engine.done = 0;
        engine.keyState[KEY_FIRE] = 0;
        engine.ssx = 0;
        engine.ssy = 0;
 
-       SDL_Rect r;
-       SDL_Rect destRect;
-       int distance = 0;
-       int interceptionChance = 0;
-
        intermission_setStatusLines();
        initShop();
        intermission_setSystemPlanets();
 
-       SDL_Surface *statsSurface = alphaRect(600, 330, 0x00, 0x00, 0x99);
-       SDL_Surface *savesSurface = createSurface(350, 300);
-       SDL_Surface *optionsSurface = createSurface(320, 240);
-       SDL_Surface *commsSurface = createSurface(450, 400);
+       SDL_Surface *statsSurface = gfx_createAlphaRect(600, 330, 0x00, 0x00, 0x99);
+       SDL_Surface *savesSurface = gfx_createSurface(350, 300);
+       SDL_Surface *optionsSurface = gfx_createSurface(320, 240);
+       SDL_Surface *commsSurface = gfx_createSurface(450, 400);
 
        createSavesSurface(savesSurface, -1);
        intermission_createOptions(optionsSurface);
        intermission_createCommsSurface(commsSurface);
 
-       signed char section = 1;
-
-       float sinX = 300;
-       float cosY = 300;
-       bool movePlanets = true;
-       signed char saveSlot = -1;
-
        // Remove the Supercharge, if it is there
        if ((game.difficulty != DIFFICULTY_EASY) &&
                (game.difficulty != DIFFICULTY_ORIGINAL))
@@ -658,46 +1196,57 @@ int intermission()
                        game.maxPlasmaDamage);
        }
 
-       if (game.system > 0)
-               interceptionChance = (300 / game.system);
-
-       // There is no chance of being interceptted after the final attack on Earth
-       if ((game.system == 3) && (systemPlanet[2].missionCompleted))
-               interceptionChance = 0;
-
-       int rtn = 0;
+       switch (game.system)
+       {
+               case SYSTEM_SPIRIT:
+                       if (game.difficulty == DIFFICULTY_ORIGINAL)
+                               interceptionChance = 0;
+                       else
+                               interceptionChance = 1. / 600.;
+                       break;
+               case SYSTEM_EYANANTH:
+                       interceptionChance = 1. / 300.;
+                       break;
+               case SYSTEM_MORDOR:
+                       interceptionChance = 1. / 150.;
+                       break;
+               case SYSTEM_SOL:
+                       // There is no chance of being interceptted after the final attack on Earth
+                       if ((game.system == SYSTEM_SOL) && (systemPlanet[2].missionCompleted))
+                               interceptionChance = 0;
+                       else
+                               interceptionChance = 1. / 100.;
+                       break;
+               default:
+                       interceptionChance = 0;
+       }
 
        if ((engine.useAudio) && (engine.useMusic))
                audio_playMusic("music/through_space.ogg", -1);
 
-       textObject iconInfo[12];
+       sprintf(string, "À±·Ï : %s·Ï", systemNames[game.system]);
+       gfx_createTextObject(TS_CURRENT_SYSTEM, string, -1, 15, FONT_WHITE);
 
-       iconInfo[0].image = textSurface("¼¡¤ÎºîÀï¤ò³«»Ï", FONT_WHITE);
-       iconInfo[1].image = textSurface("À±·Ï¥Þ¥Ã¥×", FONT_WHITE);
-       iconInfo[2].image = textSurface("Åý·×", FONT_WHITE);
-       iconInfo[3].image = textSurface("¥²¡¼¥à¤òÊݸ", FONT_WHITE);
-       iconInfo[4].image = textSurface("¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ò¶¯²½", FONT_WHITE);
-       iconInfo[5].image = textSurface("ÄÌ¿®", FONT_WHITE);
-       iconInfo[6].image = textSurface("¥ª¥×¥·¥ç¥ó", FONT_WHITE);
-       iconInfo[7].image = textSurface("¥¿¥¤¥È¥ë¤ËÌá¤ë", FONT_WHITE);
+       iconInfoY = 545;
 
-       sprintf(string, "%s·Ï", systemNames[game.system]);
-       iconInfo[8].image = textSurface(string, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_START_MISSION, "¼¡¤ÎºîÀï¤ò³«»Ï", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_GOTO, "ÌÜŪ¤ÎÏÇÀ±¤Ø¸þ¤«¤¦", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_MAP, "À±·Ï¥Þ¥Ã¥×", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_STATUS, "Åý·×", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_SAVE_GAME, "¥²¡¼¥à¤òÊݸ", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_SHOP, "¥Õ¥¡¥¤¥¢¥Õ¥é¥¤¤ò¶¯²½", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_COMMS, "ºîÀï", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_OPTIONS, "¥ª¥×¥·¥ç¥ó", -1, iconInfoY, FONT_WHITE);
+       gfx_createTextObject(TS_INFO_EXIT, "¥¿¥¤¥È¥ë¤ËÌá¤ë", -1, iconInfoY, FONT_WHITE);
 
        sprintf(string, "¸½ºß°ÌÃÖ: %s ¥¹¥Æ¡¼¥·¥ç¥ó", systemPlanet[game.stationedPlanet].name);
-       iconInfo[9].image = textSurface(string, FONT_WHITE);
+       gfx_createTextObject(TS_CURRENT_PLANET, string, 90, 450, FONT_WHITE);
 
        if (game.destinationPlanet > -1)
                sprintf(string, "ÌÜŪÃÏ: %s", systemPlanet[game.destinationPlanet].name);
        else
                strcpy(string, "ÌÜŪÃÏ: ¤Ê¤·");
-       iconInfo[10].image = textSurface(string, FONT_WHITE);
-       for (int i = 0 ; i < 9 ; i++)
-               iconInfo[i].x = (800 - iconInfo[i].image->w) / 2;
-
-       iconInfo[11].image = textSurface("ÌÜŪ¤ÎÏÇÀ±¤Ø¸þ¤«¤¦", FONT_WHITE);
-
-       bool redrawBackGround = true;
+       gfx_createTextObject(TS_DEST_PLANET, string, 550, 450, FONT_WHITE);
 
        if (game.distanceCovered > 0)
                section = 0;
@@ -710,19 +1259,19 @@ int intermission()
 
        while (!engine.done)
        {
-               updateScreen();
+               renderer_update();
 
-               if (redrawBackGround)
+               if (redrawBackground)
                {
-                       drawBackGround();
-                       redrawBackGround = false;
+                       screen_drawBackground();
+                       redrawBackground = false;
                }
                else
                {
-                       unBuffer();
+                       screen_unBuffer();
                }
 
-               doStarfield();
+               game_doStars();
 
                r.x = 0;
                r.y = 0;
@@ -747,18 +1296,13 @@ int intermission()
 
                if (rand() % 1000 < 2)
                {
-                       // XXX: This code originally had the range set to [100, 100],
-                       // which effectively always caused the star speed to be set to
-                       // 1. I don't think this was the intention, so I changed the
-                       // minimum from 100 to -100, which is what I think was probably
-                       // intended.
                        engine.ssx = RANDRANGE(-100, 100);
                        engine.ssy = RANDRANGE(-100, 100);
                        engine.ssx /= 100;
                        engine.ssy /= 100;
                }
 
-               blit(iconInfo[8].image, (int)iconInfo[8].x, 15);
+               screen_blitText(TS_CURRENT_SYSTEM);
 
                switch(section)
                {
@@ -772,15 +1316,17 @@ int intermission()
                                else
                                {
                                        distance = abs(game.stationedPlanet - game.destinationPlanet);
+                                       if (interceptionChance <= 0)
+                                               distance = 1;
+
                                        distance = (5 / distance);
                                        if (distance < 1)
                                                distance = 1;
 
-                                       SDL_FreeSurface(iconInfo[9].image);
-                                       iconInfo[9].image = textSurface(systemPlanet[game.stationedPlanet].name, FONT_WHITE);
-
-                                       SDL_FreeSurface(iconInfo[10].image);
-                                       iconInfo[10].image = textSurface(systemPlanet[game.destinationPlanet].name, FONT_WHITE);
+                                       gfx_createTextObject(TS_CURRENT_PLANET, systemPlanet[game.stationedPlanet].name,
+                                               135, 480, FONT_WHITE);
+                                       gfx_createTextObject(TS_DEST_PLANET, systemPlanet[game.destinationPlanet].name,
+                                               635, 480, FONT_WHITE);
 
                                        section = 8;
 
@@ -808,24 +1354,13 @@ int intermission()
 
                                if (intermission_showSystem(sinX, cosY, true))
                                {
-                                       if (game.system == 0)
-                                       {
-                                               sprintf(string, "¸½ºß°ÌÃÖ: %s¥¹¥Æ¡¼¥·¥ç¥ó", systemPlanet[game.stationedPlanet].name);
-                                               SDL_FreeSurface(iconInfo[9].image);
-                                               iconInfo[9].image = textSurface(string, FONT_WHITE);
-                                               intermission_updateCommsSurface(commsSurface);
-                                       }
-                                       else
-                                       {
-                                               sprintf(string, "ÌÜŪÃÏ: %s", systemPlanet[game.destinationPlanet].name);
-                                               SDL_FreeSurface(iconInfo[10].image);
-                                               iconInfo[10].image = textSurface(string, FONT_WHITE);
-                                       }
+                                       sprintf(string, "ÌÜŪÃÏ: %s", systemPlanet[game.destinationPlanet].name);
+                                       gfx_createTextObject(TS_DEST_PLANET, string, 550, 450, FONT_WHITE);
                                }
 
-                               blit(iconInfo[9].image, 90, 450);
-                               if ((game.system > 0) && (game.stationedPlanet != game.destinationPlanet))
-                                       blit(iconInfo[10].image, 550, 450);
+                               screen_blitText(TS_CURRENT_PLANET);
+                               if (game.stationedPlanet != game.destinationPlanet)
+                                       screen_blitText(TS_DEST_PLANET);
                                break;
 
                        case 2:
@@ -833,7 +1368,7 @@ int intermission()
                                break;
 
                        case 3:
-                               blit(savesSurface, 200, 100);
+                               screen_blit(savesSurface, 200, 100);
                                saveSlot = showSaveSlots(savesSurface, saveSlot);
                                break;
 
@@ -842,12 +1377,12 @@ int intermission()
                                break;
 
                        case 5:
-                               blit(commsSurface, 170, 70);
+                               screen_blit(commsSurface, 170, 70);
                                intermission_doComms(commsSurface);
                                break;
 
                        case 6:
-                               blit(optionsSurface, 230, 130);
+                               screen_blit(optionsSurface, 230, 130);
                                intermission_doOptions(optionsSurface);
                                break;
 
@@ -859,10 +1394,10 @@ int intermission()
                        case 8:
                                intermission_showSystem(sinX, cosY, false);
 
-                               blit(systemPlanet[game.stationedPlanet].image, 150, 450);
-                               blit(iconInfo[9].image, 135, 480);
-                               blit(systemPlanet[game.destinationPlanet].image, 650, 450);
-                               blit(iconInfo[10].image, 635, 480);
+                               screen_blit(systemPlanet[game.stationedPlanet].image, 150, 450);
+                               screen_blitText(TS_CURRENT_PLANET);
+                               screen_blit(systemPlanet[game.destinationPlanet].image, 650, 450);
+                               screen_blitText(TS_DEST_PLANET);
 
                                destRect.w += distance;
                                SDL_FillRect(screen, &destRect, red);
@@ -872,20 +1407,19 @@ int intermission()
                                        game.stationedPlanet = game.destinationPlanet;
                                        game.distanceCovered = 0;
                                        player.shield = player.maxShield;
-                                       sprintf(string, "¸½ºß°ÌÃÖ: %s",
+                                       sprintf(string, "¸½ºß°ÌÃÖ: %s ¥¹¥Æ¡¼¥·¥ç¥ó",
                                                systemPlanet[game.stationedPlanet].name);
                                        strcpy(game.stationedName,
                                                systemPlanet[game.stationedPlanet].name);
-                                       SDL_FreeSurface(iconInfo[9].image);
-                                       iconInfo[9].image = textSurface(string, FONT_WHITE);
+                                       gfx_createTextObject(TS_CURRENT_PLANET, string, 90, 450, FONT_WHITE);
                                        intermission_updateCommsSurface(commsSurface);
                                        section = 1;
-                                       redrawBackGround = true;
+                                       redrawBackground = true;
                                        saveGame(0);
                                }
                                else if (interceptionChance > 0)
                                {
-                                       if ((rand() % interceptionChance) == 0)
+                                       if (CHANCE(interceptionChance))
                                        {
                                                game.area = MISN_INTERCEPTION;
                                                rtn = 2;
@@ -897,49 +1431,115 @@ int intermission()
                                break;
                }
 
-               addBuffer(300, 545, 200, 15);
+               screen_addBuffer(300, 545, 200, 15);
 
                if (section != 8)
                {
-                       for (int i = 0 ; i < 8 ; i++)
+                       if ((game.stationedPlanet == game.destinationPlanet) &&
+                                       (!systemPlanet[game.stationedPlanet].missionCompleted))
+                               screen_blit(gfx_sprites[SP_START_MISSION], 80, 500);
+                       else if (game.stationedPlanet != game.destinationPlanet)
+                               screen_blit(gfx_sprites[SP_GOTO], 80, 500);
+
+                       screen_blit(gfx_sprites[SP_MAP], 170, 500);
+                       screen_blit(gfx_sprites[SP_STATUS], 260, 500);
+                       screen_blit(gfx_sprites[SP_SAVE], 350, 500);
+                       screen_blit(gfx_sprites[SP_SHOP], 440, 500);
+                       screen_blit(gfx_sprites[SP_COMM], 530, 500);
+                       screen_blit(gfx_sprites[SP_OPTIONS], 620, 500);
+                       screen_blit(gfx_sprites[SP_EXIT], 710, 500);
+
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 80, 500, 32, 32) &&
+                                       ((game.stationedPlanet != game.destinationPlanet) ||
+                                               (!systemPlanet[game.stationedPlanet].missionCompleted)))
                        {
-                               // if the mission has been completed, there is no
-                               // "Start Next Mission" icon
-                               if (i == 0)
+                               if (game.stationedPlanet == game.destinationPlanet)
+                                       screen_blitText(TS_INFO_START_MISSION);
+                               else
+                                       screen_blitText(TS_INFO_GOTO);
+
+                               if ((engine.keyState[KEY_FIRE]))
                                {
-                                       if ((game.stationedPlanet == game.destinationPlanet) &&
-                                                       (systemPlanet[game.stationedPlanet].missionCompleted != 0))
-                                               continue;
-                                       else if (game.stationedPlanet == game.destinationPlanet)
-                                               blit(shape[1], 80 + (i * 90), 500);
-                                       else if (game.stationedPlanet != game.destinationPlanet)
-                                               blit(shape[26], 80 + (i * 90), 500);
+                                       redrawBackground = true;
+                                       section = 0;
+                                       engine.keyState[KEY_FIRE] = 0;
                                }
-                               else
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 170, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_MAP);
+
+                               if ((engine.keyState[KEY_FIRE]))
                                {
-                                       blit(shape[i + 1], 80 + (i * 90), 500);
+                                       redrawBackground = true;
+                                       section = 1;
+                                       engine.keyState[KEY_FIRE] = 0;
                                }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 260, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_STATUS);
 
-                               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 80 + (i * 90), 500, 32, 32))
+                               if ((engine.keyState[KEY_FIRE]))
                                {
-                                       if (i != 0)
-                                       {
-                                               blit(iconInfo[i].image, (int)iconInfo[i].x, 545);
-                                       }
-                                       else
-                                       {
-                                               if (game.stationedPlanet == game.destinationPlanet)
-                                                       blit(iconInfo[0].image, (int)iconInfo[i].x, 545);
-                                               else
-                                                       blit(iconInfo[11].image, (int)iconInfo[i].x, 545);
-                                       }
+                                       redrawBackground = true;
+                                       section = 2;
+                                       engine.keyState[KEY_FIRE] = 0;
+                               }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 350, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_SAVE_GAME);
 
-                                       if ((engine.keyState[KEY_FIRE]))
-                                       {
-                                               redrawBackGround = true;
-                                               section = i;
-                                               engine.keyState[KEY_FIRE] = 0;
-                                       }
+                               if ((engine.keyState[KEY_FIRE]))
+                               {
+                                       redrawBackground = true;
+                                       section = 3;
+                                       engine.keyState[KEY_FIRE] = 0;
+                               }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 440, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_SHOP);
+
+                               if ((engine.keyState[KEY_FIRE]))
+                               {
+                                       redrawBackground = true;
+                                       section = 4;
+                                       engine.keyState[KEY_FIRE] = 0;
+                               }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 530, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_COMMS);
+
+                               if ((engine.keyState[KEY_FIRE]))
+                               {
+                                       redrawBackground = true;
+                                       section = 5;
+                                       engine.keyState[KEY_FIRE] = 0;
+                               }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 620, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_OPTIONS);
+
+                               if ((engine.keyState[KEY_FIRE]))
+                               {
+                                       redrawBackground = true;
+                                       section = 6;
+                                       engine.keyState[KEY_FIRE] = 0;
+                               }
+                       }
+                       else if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 710, 500, 32, 32))
+                       {
+                               screen_blitText(TS_INFO_EXIT);
+
+                               if ((engine.keyState[KEY_FIRE]))
+                               {
+                                       redrawBackground = true;
+                                       section = 7;
+                                       engine.keyState[KEY_FIRE] = 0;
                                }
                        }
                }
@@ -948,7 +1548,7 @@ int intermission()
                engine.keyState[KEY_ALTFIRE] = 0;
                intermission_doCursor();
 
-               delayFrame();
+               game_delayFrame();
        }
 
        audio_haltMusic();
@@ -956,8 +1556,6 @@ int intermission()
        SDL_FreeSurface(savesSurface);
        SDL_FreeSurface(optionsSurface);
        SDL_FreeSurface(commsSurface);
-       for (int i = 0 ; i < 12 ; i++)
-               SDL_FreeSurface(iconInfo[i].image);
 
        if (game.distanceCovered == 0)
                player.shield = player.maxShield;
index e6ae69c..4bf83b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index 2e3f857..2cf900b 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -31,57 +31,105 @@ a player can "Continue Current Game" and "Load Saved Game".
 int initSaveSlots()
 {
        char fileName[PATH_MAX];
-       int imagePos = 350;
+       int system;
+       char stationedName[255];
+       int imagePos = screen->h / 3 + 50;
        Game tempGame;
        struct stat fileInfo;
        int modTime = 0;
-       int continueSaveIndex = 0;
+       int continueSaveIndex = -1;
 
        FILE *fp;
 
        //READ SAVE GAME DATA
        for (int i = 0 ; i <= 5 ; i++)
        {
-               sprintf(fileName, "%ssave%.2d.dat", engine.userHomeDirectory, i);
-
+               sprintf(fileName, "%ssave%.2d.sav", engine.configDirectory, i);
                fp = fopen(fileName, "rb");
-               if (fp == NULL)
+               if (fp != NULL)
                {
-                       sprintf(saveSlot[i], (i == 0 ? "¥ª¡¼¥È¥»¡¼¥Ö (¶õ)" : "¶õ"));
-                       if (engine.gameSection == SECTION_TITLE)
-                               textSurface(TS_SAVESLOT_0 + i, saveSlot[i], -1, imagePos,
-                                       FONT_WHITE);
+                       if (fscanf(fp, "%d%*c", &game.saveFormat) < 1)
+                       {
+                               printf("Error: Could not determine the version of the save file.\n");
+                               sprintf(saveSlot[i], "Corrupt Game Data");
+                       }
+                       else
+                       {
+                               if (i == 0)
+                               {
+                                       sprintf(saveSlot[i], "¥ª¡¼¥È¥»¡¼¥Ö");
+                                       continueSaveIndex = 0;
+                               }
+                               else
+                               {
+                                       if (fscanf(fp, "%*[^\n]%*c%*[^\n]%*c%d %*d %*d%*c%[^\n]%*c", &system,
+                                                       stationedName) < 2)
+                                       {
+                                               sprintf(saveSlot[i], "²õ¤ì¤¿¥²¡¼¥à¥Ç¡¼¥¿");
+                                       }
+                                       else
+                                       {
+                                               sprintf(saveSlot[i], "%s·Ï %s", systemNames[system],
+                                                       stationedName);
+                                       }
+                               }
+
+                               if (engine.gameSection == SECTION_TITLE)
+                                       gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i], -1,
+                                               imagePos, FONT_WHITE);
+
+                               if (stat(fileName, &fileInfo) != -1)
+                               {
+                                       if (fileInfo.st_mtime > modTime)
+                                               {modTime = fileInfo.st_mtime; continueSaveIndex = i;}
+                               }
+                       }
+                       fclose(fp);
                }
                else
                {
-                       if (i == 0)
+                       sprintf(fileName, "%ssave%.2d.dat", engine.configDirectory, i);
+
+                       fp = fopen(fileName, "rb");
+                       if (fp == NULL)
                        {
-                               sprintf(saveSlot[i], "¥ª¡¼¥È¥»¡¼¥Ö");
+                               sprintf(saveSlot[i], (i == 0 ? "¥ª¡¼¥È¥»¡¼¥Ö (¶õ)" : "¶õ"));
+                               if (engine.gameSection == SECTION_TITLE)
+                                       gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i],
+                                               -1, imagePos, FONT_WHITE);
                        }
                        else
                        {
-                               if (fread(&tempGame, sizeof(Game), 1, fp) != 1)
+                               if (i == 0)
                                {
-                                       sprintf(saveSlot[i], "²õ¤ì¤¿¥²¡¼¥à¥Ç¡¼¥¿");
+                                       sprintf(saveSlot[i], "¥ª¡¼¥È¥»¡¼¥Ö");
+                                       continueSaveIndex = 0;
                                }
                                else
                                {
-                                       sprintf(saveSlot[i], "%s·Ï %s", systemNames[tempGame.system],
-                                               tempGame.stationedName);
+                                       if (fread(&tempGame, sizeof(Game), 1, fp) != 1)
+                                       {
+                                               sprintf(saveSlot[i], "²õ¤ì¤¿¥²¡¼¥à¥Ç¡¼¥¿");
+                                       }
+                                       else
+                                       {
+                                               sprintf(saveSlot[i], "%s·Ï %s", systemNames[tempGame.system],
+                                                       tempGame.stationedName);
+                                       }
                                }
-                       }
 
-                       if (engine.gameSection == SECTION_TITLE)
-                               textSurface(TS_SAVESLOT_0 + i, saveSlot[i], -1,
-                                       imagePos, FONT_WHITE);
+                               if (engine.gameSection == SECTION_TITLE)
+                                       gfx_createTextObject(TS_SAVESLOT_0 + i, saveSlot[i], -1,
+                                               imagePos, FONT_WHITE);
 
-                       if (stat(fileName, &fileInfo) != -1)
-                       {
-                               if (fileInfo.st_mtime > modTime)
-                                       {modTime = fileInfo.st_mtime; continueSaveIndex = i;}
-                       }
+                               if (stat(fileName, &fileInfo) != -1)
+                               {
+                                       if (fileInfo.st_mtime > modTime)
+                                               {modTime = fileInfo.st_mtime; continueSaveIndex = i;}
+                               }
 
-                       fclose(fp);
+                               fclose(fp);
+                       }
                }
                imagePos += 20;
        }
@@ -96,32 +144,107 @@ bool loadGame(int slot)
 {
        char filename[PATH_MAX];
        FILE *fp;
-       sprintf(filename, "%ssave%.2d.dat", engine.userHomeDirectory, slot);
+       unsigned long timeTaken;
 
+       sprintf(filename, "%ssave%.2d.sav", engine.configDirectory, slot);
        fp = fopen(filename, "rb");
 
-       if (fp == NULL)
-               return false;
-
-       if (fread(&game, sizeof(Game), 1, fp) != 1)
+       if (fp != NULL)
        {
-               printf("Save game error. The file was not of the expected format.\n");
+               if (fscanf(fp, "%d%*c", &game.saveFormat) < 1)
+               {
+                       printf("Error: Could not determine the version of the save file.\n");
+                       fclose(fp);
+                       return false;
+               }
+
+               switch (game.saveFormat)
+               {
+                       case 4:
+                               if ((fscanf(fp, "%d%*c", &game.difficulty) < 1) ||
+                                               (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
+                                                       &game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
+                                                       &game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
+                                                       &game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
+                                                       &game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8) ||
+                                               (fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
+                                                       &game.stationedPlanet) < 3) ||
+                                               (fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2) ||
+                                               (fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
+                                                       &player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4) ||
+                                               (fscanf(fp, "%d %d %d%*c",
+                                                       &weapon[W_PLAYER_WEAPON].ammo[0],
+                                                       &weapon[W_PLAYER_WEAPON].damage,
+                                                       &weapon[W_PLAYER_WEAPON].reload[0]) < 3) ||
+                                               (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
+                                                       &game.minPlasmaRate, &game.minPlasmaDamage,
+                                                       &game.minPlasmaOutput, &game.maxPlasmaRate,
+                                                       &game.maxPlasmaDamage, &game.maxPlasmaOutput,
+                                                       &game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8) ||
+                                               (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
+                                                       &game.missionCompleted[0], &game.missionCompleted[1],
+                                                       &game.missionCompleted[2], &game.missionCompleted[3],
+                                                       &game.missionCompleted[4], &game.missionCompleted[5],
+                                                       &game.missionCompleted[6], &game.missionCompleted[7],
+                                                       &game.missionCompleted[8], &game.missionCompleted[9]) < 10) ||
+                                               (fscanf(fp, "%d%*c", &game.experimentalShield) < 1) ||
+                                               (fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2) ||
+                                               (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
+                                                       &game.shots, &game.hits, &game.accuracy, &game.totalKills,
+                                                       &game.wingMate1Kills, &game.wingMate2Kills,
+                                                       &game.wingMate1Ejects, &game.wingMate2Ejects,
+                                                       &game.totalOtherKills, &game.shieldPickups,
+                                                       &game.rocketPickups, &game.cellPickups, &game.powerups,
+                                                       &game.minesKilled, &game.slavesRescued) < 15) ||
+                                               (fscanf(fp, "%lu%*c", &timeTaken) < 1))
+                               {
+                                       printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
+                               }
+                               else
+                               {
+                                       game.timeTaken = (Uint32)(timeTaken);
+                               }
+                               game.destinationPlanet = game.stationedPlanet;
+                               break;
+                       default:
+                               printf("Error: Save format version not recognized.\n");
+                               fclose(fp);
+                               return false;
+               }
+
                fclose(fp);
-               return false;
        }
+       else
+       {
+               sprintf(filename, "%ssave%.2d.dat", engine.configDirectory, slot);
+               fp = fopen(filename, "rb");
 
-       fclose(fp);
+               if (fp == NULL)
+                       return false;
 
-       if (game.saveFormat < 2)
-               game.difficulty = DIFFICULTY_NORMAL;
+               if (fread(&game, sizeof(Game), 1, fp) != 1)
+               {
+                       printf("Save game error. The file was not of the expected format.\n");
+                       fclose(fp);
+                       return false;
+               }
+
+               fclose(fp);
 
-       weapon[W_PLAYER_WEAPON] = game.playerWeapon;
-       player = game.thePlayer;
+               if (game.saveFormat < 2)
+                       game.difficulty = DIFFICULTY_NORMAL;
+
+               weapon[W_PLAYER_WEAPON] = game.playerWeapon;
+               weapon[W_PLAYER_WEAPON].imageIndex[0] = SP_PLASMA_GREEN;
+               weapon[W_PLAYER_WEAPON].imageIndex[1] = SP_PLASMA_GREEN;
+               player = game.thePlayer;
+       }
 
        // Re-init all the planets in this system...
        initPlanetMissions(game.system);
 
        // ... and then override with completition status
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
                systemPlanet[i].missionCompleted = game.missionCompleted[i];
 
@@ -139,18 +262,75 @@ void saveGame(int slot)
                return;
        }
 
-       sprintf(fileName, "%ssave%.2d.dat", engine.userHomeDirectory, slot);
+       sprintf(fileName, "%ssave%.2d.sav", engine.configDirectory, slot);
        fp = fopen(fileName, "wb");
 
-       game.saveFormat = 3;
-       game.playerWeapon = weapon[W_PLAYER_WEAPON];
-       game.thePlayer = player;
+
+       game.saveFormat = 4;
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
                game.missionCompleted[i] = systemPlanet[i].missionCompleted;
 
        if (fp != NULL)
        {
-               if (fwrite(&game, sizeof(Game), 1, fp) != 1)
+               if (fprintf(fp,
+                               "%d\n"
+                               "%d\n"
+                               "%d %d %d %d %d %d %d %d\n"
+                               "%d %d %d\n"
+                               "%s\n"
+                               "%d %d\n"
+                               "%d %d %d %d\n"
+                               "%d %d %d\n"
+                               "%d %d %d %d %d %d %d %d\n"
+                               "%d %d %d %d %d %d %d %d %d %d 0 0 0 0 0 0 0 0 0 0\n"
+                               "%d\n"
+                               "%d %d\n"
+                               "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"
+                               "%lu\n",
+
+                               game.saveFormat,
+
+                               game.difficulty,
+
+                               game.minPlasmaRateLimit, game.minPlasmaDamageLimit,
+                               game.minPlasmaOutputLimit, game.maxPlasmaRateLimit,
+                               game.maxPlasmaDamageLimit, game.maxPlasmaOutputLimit,
+                               game.maxPlasmaAmmoLimit, game.maxRocketAmmoLimit,
+
+                               game.system, game.area, game.stationedPlanet,
+
+                               systemPlanet[game.stationedPlanet].name,
+
+                               game.hasWingMate1, game.hasWingMate2,
+
+                               player.maxShield, player.ammo[0], player.ammo[1],
+                               player.weaponType[1],
+
+                               weapon[W_PLAYER_WEAPON].ammo[0], weapon[W_PLAYER_WEAPON].damage,
+                               weapon[W_PLAYER_WEAPON].reload[0],
+
+                               game.minPlasmaRate, game.minPlasmaDamage, game.minPlasmaOutput,
+                               game.maxPlasmaRate, game.maxPlasmaDamage, game.maxPlasmaOutput,
+                               game.maxPlasmaAmmo, game.maxRocketAmmo,
+
+                               game.missionCompleted[0], game.missionCompleted[1],
+                               game.missionCompleted[2], game.missionCompleted[3],
+                               game.missionCompleted[4], game.missionCompleted[5],
+                               game.missionCompleted[6], game.missionCompleted[7],
+                               game.missionCompleted[8], game.missionCompleted[9],
+
+                               game.experimentalShield,
+
+                               game.cash, game.cashEarned,
+
+                               game.shots, game.hits, game.accuracy, game.totalKills,
+                               game.wingMate1Kills, game.wingMate2Kills, game.wingMate1Ejects,
+                               game.wingMate2Ejects, game.totalOtherKills, game.shieldPickups,
+                               game.rocketPickups, game.cellPickups, game.powerups,
+                               game.minesKilled, game.slavesRescued,
+
+                               (unsigned long)(game.timeTaken)) <= 0)
                {
                        printf("Error Saving Game to Slot %d\n", slot);
                }
@@ -166,23 +346,23 @@ void saveGame(int slot)
        engine.keyState[KEY_FIRE] = 0;
 }
 
-void createSavesSurface(SDL_Surface *savesSurface, signed char clickedSlot)
+void createSavesSurface(SDL_Surface *savesSurface, int clickedSlot)
 {
        int y = 10;
 
-       blevelRect(savesSurface, 0, 0, 348, 298, 0x00, 0x00, 0x00);
+       gfx_drawRect(savesSurface, 0, 0, 348, 298, 0x00, 0x00, 0x00);
 
        for (int i = 1 ; i <= 5 ; i++)
        {
                if (clickedSlot == i)
-                       blevelRect(savesSurface, 5, y, 338, 25, 0x99, 0x00, 0x00);
+                       gfx_drawRect(savesSurface, 5, y, 338, 25, 0x99, 0x00, 0x00);
                else
-                       blevelRect(savesSurface, 5, y, 338, 25, 0x00, 0x00, 0x99);
-               drawString(saveSlot[i], 70, y + 5, FONT_WHITE, savesSurface);
+                       gfx_drawRect(savesSurface, 5, y, 338, 25, 0x00, 0x00, 0x99);
+               gfx_renderString(saveSlot[i], 70, y + 5, FONT_WHITE, 0, savesSurface);
                y += 30;
        }
 
-       drawString("*** ¥Ø¥ë¥× ***", 120, 170, FONT_WHITE, savesSurface);
+       gfx_renderString("*** ¥Ø¥ë¥× ***", 120, 170, FONT_WHITE, 0, savesSurface);
 
        switch (clickedSlot)
        {
@@ -191,28 +371,31 @@ void createSavesSurface(SDL_Surface *savesSurface, signed char clickedSlot)
                case 3:
                case 4:
                case 5:
-                       blevelRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
-                       blevelRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
-                       blevelRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
-                       drawString("Êݸ", 40, 270, FONT_WHITE, savesSurface);
-                       drawString("¼è¤ê¾Ã¤·", 150, 270, FONT_WHITE, savesSurface);
-                       drawString("ºï½ü", 270, 270, FONT_WHITE, savesSurface);
-
-                       drawString("[Êݸ] ¥²¡¼¥à¤Î¾õÂÖ¤òÊݸ¤¹¤ë", 17, 200, FONT_WHITE, savesSurface);
-                       drawString("[¼è¤ê¾Ã¤·] ¥¹¥í¥Ã¥È¤ÎÁªÂò¤ò²ò½ü¤¹¤ë", 17, 220, FONT_WHITE,
-                               savesSurface);
-                       drawString("[ºï½ü] Êݸ¤·¤¿¾õÂÖ¤òºï½ü¤¹¤ë", 17, 240, FONT_WHITE,
+                       gfx_drawRect(savesSurface, 5, 265, 100, 25, 0x00, 0x99, 0x00);
+                       gfx_drawRect(savesSurface, 125, 265, 100, 25, 0x99, 0x99, 0x00);
+                       gfx_drawRect(savesSurface, 243, 265, 100, 25, 0x99, 0x00, 0x00);
+                       gfx_renderString("Êݸ", 40, 270, FONT_WHITE, 0, savesSurface);
+                       gfx_renderString("¼è¤ê¾Ã¤·", 150, 270, FONT_WHITE, 0, savesSurface);
+                       gfx_renderString("ºï½ü", 270, 270, FONT_WHITE, 0, savesSurface);
+
+                       gfx_renderString("[Êݸ] ¥²¡¼¥à¤Î¾õÂÖ¤òÊݸ¤¹¤ë", 17, 200, FONT_WHITE, 0,
                                savesSurface);
+                       gfx_renderString("[¼è¤ê¾Ã¤·] ¥¹¥í¥Ã¥È¤ÎÁªÂò¤ò²ò½ü¤¹¤ë", 17, 220,
+                               FONT_WHITE, 0, savesSurface);
+                       gfx_renderString("[ºï½ü] Êݸ¤·¤¿¾õÂÖ¤òºï½ü¤¹¤ë", 17, 240,
+                               FONT_WHITE, 0, savesSurface);
                        break;
                case -1:
-                       drawString("¥¹¥í¥Ã¥È¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤", 17, 200,
-                               FONT_WHITE, savesSurface);
+                       gfx_renderString("¥¹¥í¥Ã¥È¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤", 17, 200,
+                               FONT_WHITE, 0, savesSurface);
                        break;
                case -10:
-                       drawString("Êݸ¤·¤¿", 130, 200, FONT_WHITE, savesSurface);
+                       gfx_renderString("Êݸ¤·¤Þ¤·¤¿", 130, 200, FONT_WHITE, 0,
+                               savesSurface);
                        break;
                case -11:
-                       drawString("ºï½ü¤·¤¿", 130, 200, FONT_WHITE, savesSurface);
+                       gfx_renderString("ºï½ü¤·¤Þ¤·¤¿", 130, 200, FONT_WHITE, 0,
+                               savesSurface);
                        break;
        }
 
@@ -224,7 +407,7 @@ Displays the save slot available. For use with an interface that
 has the cursor enabled. It returns the index number of the slot clicked
 so that the function invoking it can perform a load or save on that slot.
 */
-int showSaveSlots(SDL_Surface *savesSurface, signed char saveSlot)
+int showSaveSlots(SDL_Surface *savesSurface, int saveSlot)
 {
        int clickedSlot = -1;
 
@@ -238,7 +421,7 @@ int showSaveSlots(SDL_Surface *savesSurface, signed char saveSlot)
        {
                for (int i = 1 ; i <= 5 ; i++)
                {
-                       if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
                                r.x, r.y, r.w, r.h))
                        {
                                clickedSlot = i;
@@ -247,22 +430,22 @@ int showSaveSlots(SDL_Surface *savesSurface, signed char saveSlot)
                        r.y += 30;
                }
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 215,
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 215,
                        365, 100, 25))
                {
                        saveGame(saveSlot);
                        createSavesSurface(savesSurface, -10);
                }
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 335,
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 335,
                                365, 100, 25))
                        createSavesSurface(savesSurface, -1);
 
-               if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 453,
+               if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 453,
                        365, 100, 25))
                {
                        char filename[PATH_MAX];
-                       sprintf(filename, "%ssave%.2d.dat", engine.userHomeDirectory,
+                       sprintf(filename, "%ssave%.2d.dat", engine.configDirectory,
                                saveSlot);
                        remove(filename);
                        initSaveSlots();
index 8356291..50e452a 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern int initSaveSlots();
 extern bool loadGame(int slot);
 extern void saveGame(int slot);
-extern void createSavesSurface(SDL_Surface *savesSurface, signed char clickedSlot);
-extern int showSaveSlots(SDL_Surface *savesSurface, signed char saveSlot);
+extern void createSavesSurface(SDL_Surface *savesSurface, int clickedSlot);
+extern int showSaveSlots(SDL_Surface *savesSurface, int saveSlot);
 
 #endif
index db5a644..453e431 100644 (file)
@@ -1,6 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -62,7 +63,7 @@ void getKillMessage(object *ally)
        char in[50], otherName[30];
        int kills, difference;
        bool firstPlace = false;
-       int faceToUse = FACE_PHOEBE;
+       int faceToUse = FS_PHOEBE;
 
        if (ally == &aliens[ALIEN_PHOEBE])
        {
@@ -72,7 +73,7 @@ void getKillMessage(object *ally)
                if ((game.wingMate1Kills > game.wingMate2Kills) &&
                                (game.wingMate1Kills > game.totalKills))
                        firstPlace = true;
-               faceToUse = FACE_PHOEBE;
+               faceToUse = FS_PHOEBE;
        }
        else
        {
@@ -82,7 +83,7 @@ void getKillMessage(object *ally)
                if ((game.wingMate2Kills > game.wingMate1Kills) &&
                                (game.wingMate2Kills > game.totalKills))
                        firstPlace = true;
-               faceToUse = FACE_URSULA;
+               faceToUse = FS_URSULA;
        }
 
        int r = rand() % 10;
@@ -149,28 +150,28 @@ void getPlayerDeathMessage()
 {
        if (aliens[ALIEN_KLINE].active)
        {
-               setRadioMessage(FACE_KLINE, getKlineInsult(), 1);
+               setRadioMessage(FS_KLINE, getKlineInsult(), 1);
                return;
        }
        
        if ((aliens[ALIEN_BOSS].active) && (aliens[ALIEN_BOSS].classDef == CD_KRASS))
        {
-               setRadioMessage(FACE_KRASS, "¤³¤ì¤Ç$90,000,000¤È¤Ï¥Á¥ç¥í¤¤¤â¤ó¤À! ¥¬¥Ï¥Ï! ¥Ï¥Ã!! ¥Ï¥Ã!! ¥Ï¥Ã!!", 1);
+               setRadioMessage(FS_KRASS, "¤³¤ì¤Ç$90,000,000¤È¤Ï¥Á¥ç¥í¤¤¤â¤ó¤À! ¥¬¥Ï¥Ï¥Ï¥Ï¥Ï¥Ã!!", 1);
                return;
        }
 
-       int faceToUse = FACE_PHOEBE;
+       int faceToUse = FS_PHOEBE;
        
 
        if ((game.area == MISN_URUSOR) || (game.area == MISN_POSWIC) ||
                (game.area == MISN_EARTH))
        {
-               faceToUse = FACE_SID;
+               faceToUse = FS_SID;
        }
        else if (game.hasWingMate2)
        {
                if ((rand() % 2) == 0)
-                       faceToUse = FACE_URSULA;
+                       faceToUse = FS_URSULA;
        }
 
        setRadioMessage(faceToUse, deathMessage[rand() % 6], 1);
@@ -178,24 +179,24 @@ void getPlayerDeathMessage()
 
 void getMissFireMessage(object *ally)
 {
-       int faceToUse = FACE_PHOEBE;
+       int faceToUse = FS_PHOEBE;
 
        if (ally == &aliens[ALIEN_PHOEBE])
-               faceToUse = FACE_PHOEBE;
+               faceToUse = FS_PHOEBE;
        else
-               faceToUse = FACE_URSULA;
+               faceToUse = FS_URSULA;
 
        setRadioMessage(faceToUse, missFireMessage[rand() % 5], 0);
 }
 
 void getPlayerHitMessage(object *ally)
 {
-       int faceToUse = FACE_PHOEBE;
+       int faceToUse = FS_PHOEBE;
 
        if (ally == &aliens[ALIEN_PHOEBE])
-               faceToUse = FACE_PHOEBE;
+               faceToUse = FS_PHOEBE;
        else
-               faceToUse = FACE_URSULA;
+               faceToUse = FS_URSULA;
 
        setRadioMessage(faceToUse, playerHitMessage[rand() % 3], 0);
 }
index ca0d0af..5c6591b 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index d93544b..5431432 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -23,15 +23,15 @@ void clearInfoLines()
 {
        for (int i = 0 ; i < 4 ; i++)
        {
-               textShape[i].life = 0;
+               gfx_textSprites[i].life = 0;
        }
 }
 
 // from a to b
 void copyInfoLine(int a, int b)
 {
-       textSurface(b, textShape[a].text, -1, 0, textShape[a].fontColor);
-       textShape[b].life = textShape[a].life;
+       gfx_createTextObject(b, gfx_textSprites[a].text, -1, 0, gfx_textSprites[a].fontColor);
+       gfx_textSprites[b].life = gfx_textSprites[a].life;
 }
 
 /*
@@ -44,9 +44,9 @@ void setInfoLine(const char *in, int color)
 {
        int index = -1;
 
-       for (int i = 0 ; i < 3 ; i++)
+       for (int i = 0 ; i < MAX_INFOLINES ; i++)
        {
-               if ((textShape[i].life == 0) && (index == -1))
+               if ((gfx_textSprites[i].life == 0) && (index == -1))
                {
                        index = i;
                }
@@ -55,13 +55,15 @@ void setInfoLine(const char *in, int color)
        // Bump down
        if (index == -1)
        {
-               index = 2;
-               copyInfoLine(1, 0);
-               copyInfoLine(2, 1);
+               index = MAX_INFOLINES - 1;
+               for (int i = 1 ; i < MAX_INFOLINES ; i++)
+               {
+                       copyInfoLine(i, i - 1);
+               }
        }
 
-       textSurface(index, in, -1, 0, color);
-       textShape[index].life = 240;
+       gfx_createTextObject(index, in, -1, 0, color);
+       gfx_textSprites[index].life = 240;
 }
 
 /*
@@ -69,19 +71,20 @@ Sets a radio message that appears at the top of the screen. Used for
 script events, etc. We send a message priority too, since we don't want
 Phoebe or Ursula's banter to interrupt an important message
 */
-void setRadioMessage(signed char face, const char *in, int priority)
+void setRadioMessage(int face, const char *in, int priority)
 {
-       if ((textShape[3].life > 0) && (priority == 0))
+       SDL_Surface *faceShape = NULL;
+
+       if ((gfx_textSprites[TS_RADIO].life > 0) && (priority == 0))
                return;
 
-       textSurface(3, in, -1, 50, FONT_WHITE);
-       textShape[3].life = 240;
+       gfx_createTextObject(TS_RADIO, in, -1, 50, FONT_WHITE);
+       gfx_textSprites[TS_RADIO].life = 240;
 
-       SDL_Surface *faceShape = NULL;
        if (face > -1)
-               faceShape = shape[face];
+               faceShape = gfx_faceSprites[face];
 
-       createMessageBox(faceShape, in, 1);
+       gfx_createMessageBox(faceShape, in, 1);
 }
 
 static const char *faces[] = {
@@ -95,7 +98,7 @@ int getFace(const char *face)
        for (int i = 0 ; i < 7 ; i++)
        {
                if (strcmp(faces[i], face) == 0)
-                       return 90 + i;
+                       return FS_CHRIS + i;
        }
 
        return -1;
@@ -138,7 +141,7 @@ void resetLists()
        engine.collectableHead->next = NULL;
        engine.collectableTail = engine.collectableHead;
        
-       r1 = bufferHead->next;
+       r1 = screen_bufferHead->next;
        while (r1 != NULL)
        {
                r2 = r1;
@@ -146,8 +149,8 @@ void resetLists()
                delete r2;
        }
        
-       bufferHead->next = NULL;
-       bufferTail = bufferHead;
+       screen_bufferHead->next = NULL;
+       screen_bufferTail = screen_bufferHead;
 
        ob = engine.debrisHead->next;
        while(ob != NULL)
index 78efea7..3f858a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern void clearInfoLines();
 void copyInfoLine(int a, int b);
 extern void setInfoLine(const char *in, int color);
-extern void setRadioMessage(signed char face, const char *in, int priority);
+extern void setRadioMessage(int face, const char *in, int priority);
 extern int getFace(const char *face);
 extern void resetLists();
 
index 69c6b02..2a615dd 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -19,14 +19,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
-// God, I hate this file! :((
-
+// XXX: Magic number
 Planet systemPlanet[10];
 mission currentMission;
 static mission missions[MISN_MAX];
 
-void initPlanetMissions(signed char system)
+void initPlanetMissions(int system)
 {
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
        {
                systemPlanet[i].missionNumber = -1; // no mission for this planet
@@ -36,98 +36,98 @@ void initPlanetMissions(signed char system)
        switch(system)
        {
                // Spirit
-               case 0:
-                       systemPlanet[0].missionNumber = MISN_HAIL;
-                       systemPlanet[0].missionCompleted = 0;
+               case SYSTEM_SPIRIT:
+                       systemPlanet[PLANET_HAIL].missionNumber = MISN_HAIL;
+                       systemPlanet[PLANET_HAIL].missionCompleted = 0;
 
-                       systemPlanet[1].missionNumber = MISN_CERADSE;
-                       systemPlanet[1].missionCompleted = 0;
+                       systemPlanet[PLANET_CERADSE].missionNumber = MISN_CERADSE;
+                       systemPlanet[PLANET_CERADSE].missionCompleted = 0;
 
-                       systemPlanet[2].missionNumber = MISN_HINSTAG;
-                       systemPlanet[2].missionCompleted = 0;
+                       systemPlanet[PLANET_HINSTAG].missionNumber = MISN_HINSTAG;
+                       systemPlanet[PLANET_HINSTAG].missionCompleted = 0;
 
-                       systemPlanet[3].missionNumber = MISN_JOLDAR;
-                       systemPlanet[3].missionCompleted = 0;
+                       systemPlanet[PLANET_JOLDAR].missionNumber = MISN_JOLDAR;
+                       systemPlanet[PLANET_JOLDAR].missionCompleted = 0;
 
-                       systemPlanet[4].missionNumber = MISN_MOEBO;
-                       systemPlanet[4].missionCompleted = -1;
+                       systemPlanet[PLANET_MOEBO].missionNumber = MISN_MOEBO;
+                       systemPlanet[PLANET_MOEBO].missionCompleted = -1;
 
                        break;
 
                // Eyananth
-               case 1:
-                       systemPlanet[0].missionNumber = MISN_NEROD;
-                       systemPlanet[0].missionCompleted = 0;
+               case SYSTEM_EYANANTH:
+                       systemPlanet[PLANET_NEROD].missionNumber = MISN_NEROD;
+                       systemPlanet[PLANET_NEROD].missionCompleted = 0;
 
-                       systemPlanet[1].missionNumber = MISN_ALLEZ;
-                       systemPlanet[1].missionCompleted = 0;
+                       systemPlanet[PLANET_ALLEZ].missionNumber = MISN_ALLEZ;
+                       systemPlanet[PLANET_ALLEZ].missionCompleted = 0;
 
-                       systemPlanet[2].missionNumber = MISN_URUSOR;
-                       systemPlanet[2].missionCompleted = -1;
+                       systemPlanet[PLANET_URUSOR].missionNumber = MISN_URUSOR;
+                       systemPlanet[PLANET_URUSOR].missionCompleted = -1;
 
-                       systemPlanet[3].missionNumber = MISN_DORIM;
-                       systemPlanet[3].missionCompleted = -1;
+                       systemPlanet[PLANET_DORIM].missionNumber = MISN_DORIM;
+                       systemPlanet[PLANET_DORIM].missionCompleted = -1;
 
-                       systemPlanet[4].missionNumber = MISN_ELAMALE;
-                       systemPlanet[4].missionCompleted = -2;
+                       systemPlanet[PLANET_ELAMALE].missionNumber = MISN_ELAMALE;
+                       systemPlanet[PLANET_ELAMALE].missionCompleted = -2;
 
                        // This one is for the slaves
-                       systemPlanet[9].missionNumber = MISN_RESCUESLAVES;
-                       systemPlanet[9].missionCompleted = 0;
+                       systemPlanet[PLANET_RESCUESLAVES].missionNumber = MISN_RESCUESLAVES;
+                       systemPlanet[PLANET_RESCUESLAVES].missionCompleted = 0;
 
                        break;
 
                // Mordor
-               case 2:
-                       systemPlanet[0].missionNumber = MISN_ODEON;
-                       systemPlanet[0].missionCompleted = 0;
+               case SYSTEM_MORDOR:
+                       systemPlanet[PLANET_ODEON].missionNumber = MISN_ODEON;
+                       systemPlanet[PLANET_ODEON].missionCompleted = 0;
 
-                       systemPlanet[1].missionNumber = MISN_FELLON;
-                       systemPlanet[1].missionCompleted = 0;
+                       systemPlanet[PLANET_FELLON].missionNumber = MISN_FELLON;
+                       systemPlanet[PLANET_FELLON].missionCompleted = 0;
 
-                       systemPlanet[2].missionNumber = MISN_SIVEDI;
-                       systemPlanet[2].missionCompleted = -1;
+                       systemPlanet[PLANET_SIVEDI].missionNumber = MISN_SIVEDI;
+                       systemPlanet[PLANET_SIVEDI].missionCompleted = -1;
 
-                       systemPlanet[3].missionNumber = MISN_ALMARTHA;
-                       systemPlanet[3].missionCompleted = -1;
+                       systemPlanet[PLANET_ALMARTHA].missionNumber = MISN_ALMARTHA;
+                       systemPlanet[PLANET_ALMARTHA].missionCompleted = -1;
 
-                       systemPlanet[4].missionNumber = MISN_POSWIC;
-                       systemPlanet[4].missionCompleted = -2;
+                       systemPlanet[PLANET_POSWIC].missionNumber = MISN_POSWIC;
+                       systemPlanet[PLANET_POSWIC].missionCompleted = -2;
 
-                       systemPlanet[5].missionNumber = MISN_ELLESH;
-                       systemPlanet[5].missionCompleted = -3;
+                       systemPlanet[PLANET_ELLESH].missionNumber = MISN_ELLESH;
+                       systemPlanet[PLANET_ELLESH].missionCompleted = -3;
 
                        // This one is for the experimental fighter
-                       systemPlanet[9].missionNumber = MISN_CLOAKFIGHTER;
-                       systemPlanet[9].missionCompleted = 0;
+                       systemPlanet[PLANET_CLOAKFIGHTER].missionNumber = MISN_CLOAKFIGHTER;
+                       systemPlanet[PLANET_CLOAKFIGHTER].missionCompleted = 0;
 
                        break;
 
                // Sol
-               case 3:
-                       systemPlanet[8].missionNumber = MISN_PLUTO;
-                       systemPlanet[8].missionCompleted = 0;
+               case SYSTEM_SOL:
+                       systemPlanet[PLANET_PLUTO].missionNumber = MISN_PLUTO;
+                       systemPlanet[PLANET_PLUTO].missionCompleted = 0;
 
-                       systemPlanet[7].missionNumber = MISN_NEPTUNE;
-                       systemPlanet[7].missionCompleted = 0;
+                       systemPlanet[PLANET_NEPTUNE].missionNumber = MISN_NEPTUNE;
+                       systemPlanet[PLANET_NEPTUNE].missionCompleted = 0;
 
-                       systemPlanet[6].missionNumber = MISN_URANUS;
-                       systemPlanet[6].missionCompleted = 0;
+                       systemPlanet[PLANET_URANUS].missionNumber = MISN_URANUS;
+                       systemPlanet[PLANET_URANUS].missionCompleted = 0;
 
-                       systemPlanet[5].missionNumber = MISN_SATURN;
-                       systemPlanet[5].missionCompleted = -1;
+                       systemPlanet[PLANET_SATURN].missionNumber = MISN_SATURN;
+                       systemPlanet[PLANET_SATURN].missionCompleted = -1;
 
-                       systemPlanet[4].missionNumber = MISN_JUPITER;
-                       systemPlanet[4].missionCompleted = -2;
+                       systemPlanet[PLANET_JUPITER].missionNumber = MISN_JUPITER;
+                       systemPlanet[PLANET_JUPITER].missionCompleted = -2;
 
-                       systemPlanet[3].missionNumber = MISN_MARS;
-                       systemPlanet[3].missionCompleted = -3;
+                       systemPlanet[PLANET_MARS].missionNumber = MISN_MARS;
+                       systemPlanet[PLANET_MARS].missionCompleted = -3;
 
-                       systemPlanet[2].missionNumber = MISN_EARTH;
-                       systemPlanet[2].missionCompleted = -4;
+                       systemPlanet[PLANET_EARTH].missionNumber = MISN_EARTH;
+                       systemPlanet[PLANET_EARTH].missionCompleted = -4;
 
-                       systemPlanet[1].missionNumber = MISN_VENUS;
-                       systemPlanet[1].missionCompleted = -5;
+                       systemPlanet[PLANET_VENUS].missionNumber = MISN_VENUS;
+                       systemPlanet[PLANET_VENUS].missionCompleted = -5;
 
                        break;
        }
@@ -135,6 +135,7 @@ void initPlanetMissions(signed char system)
 
 void checkForBossMission()
 {
+       // XXX: Magic number
        for (int i = 0 ; i < 10 ; i++)
        {
                if ((systemPlanet[i].missionCompleted == 0) && (systemPlanet[i].missionNumber != -1))
@@ -221,7 +222,7 @@ static void clearAllMissions()
                for (int i = 0 ; i < 3 ; i++)
                {
                        strcpy(missions[m].primaryObjective[i], "");
-                       missions[m].primaryType[i] = NONE;
+                       missions[m].primaryType[i] = M_NONE;
                        missions[m].target1[i] = -1;
                        missions[m].targetValue1[i] = -1;
                        missions[m].timeLimit1[i] = -2;
@@ -231,7 +232,7 @@ static void clearAllMissions()
                for (int i = 0 ; i < 3 ; i++)
                {
                        strcpy(missions[m].secondaryObjective[i], "");
-                       missions[m].secondaryType[i] = NONE;
+                       missions[m].secondaryType[i] = M_NONE;
                        missions[m].target2[i] = -1;
                        missions[m].targetValue2[i] = -1;
                        missions[m].timeLimit2[i] = -2;
@@ -259,9 +260,9 @@ void setMission(int mission)
                if (currentMission.timeLimit2[i] > engine.minutes)
                        engine.minutes = currentMission.timeLimit2[i];
 
-               if (currentMission.completed1[i] == 0)
+               if (currentMission.completed1[i] == OB_INCOMPLETE)
                        currentMission.remainingObjectives1++;
-               if (currentMission.completed2[i] == 0)
+               if (currentMission.completed2[i] == OB_INCOMPLETE)
                        currentMission.remainingObjectives1++;
        }
 
@@ -296,13 +297,13 @@ void checkTimer()
        for (int i = 0 ; i < 3 ; i++)
        {
                if ((currentMission.timeLimit1[i] == -1) && (currentMission.completed1[i] == OB_INCOMPLETE))
-                       currentMission.completed1[i] = -2;
+                       currentMission.completed1[i] = OB_JUST_FAILED;
        }
 
        for (int i = 0 ; i < 3 ; i++)
        {
                if ((currentMission.timeLimit2[i] == -1) && (currentMission.completed2[i] == OB_INCOMPLETE))
-                       currentMission.completed2[i] = -2;
+                       currentMission.completed2[i] = OB_JUST_FAILED;
        }
 
        // Find out if there are any uncompleted missions that require the timer
@@ -336,12 +337,12 @@ static void evaluateRequirement(int type, int id, int *completed, int *targetVal
        char message[25];
 
        if ((*targetValue <= 0) && (type != M_PROTECT_TARGET) &&
-               (type != M_PROTECT_PICKUP))
+                       (type != M_PROTECT_PICKUP))
        {
-               *completed = 2;
+               *completed = OB_JUST_COMPLETED;
                checkTimer();
                if ((game.area == MISN_URUSOR) && (type == M_DISABLE_TARGET))
-                       setRadioMessage(FACE_SID, "Êäµë´Ï¤òÁ´¤Æ¹Ò¹ÔÉÔǽ¤Ë¤·¤¿!", 1);
+                       setRadioMessage(FS_SID, "Êäµë´Ï¤ò¹Ò¹ÔÉÔǽ¤Ë¤·¤¿!", 1);
        }
        else
        {
@@ -369,35 +370,35 @@ static void evaluateRequirement(int type, int id, int *completed, int *targetVal
                                }
                                break;
                        case M_PROTECT_PICKUP:
-                               *completed = -2;
+                               *completed = OB_JUST_FAILED;
                                switch(id)
                                {
                                        case P_CARGO:
                                                sprintf(message, "²ßʪ¤¬Ç˲õ¤µ¤ì¤¿!");
                                                if (game.area == MISN_CERADSE) // Get lectured by Sid
-                                                       setRadioMessage(FACE_SID, "¥¯¥ê¥¹¡¢½ÅÍפʲßʪ¤À¤¾!! 1¤Ä¤â¼º¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¤È¸À¤Ã¤¿¤Ï¤º¤À!!", 1);
+                                                       setRadioMessage(FS_SID, "¥¯¥ê¥¹¡¢½ÅÍפʲßʪ¤À¤¾!! 1¤Ä¤â¼º¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¤È¸À¤Ã¤¿¤Ï¤º¤À!!", 1);
                                                break;
                                        case P_ESCAPEPOD:
                                                sprintf(message, "æ½Ð¥Ý¥Ã¥É¤¬¼º¤ï¤ì¤¿!");
                                                if (game.area == MISN_ODEON) // Get lectured by Phoebe
-                                                       setRadioMessage(FACE_PHOEBE, "¤¢¤¢¡Ä¥¦¡¼¥·¥å¥é¡Ä", 1);
+                                                       setRadioMessage(FS_PHOEBE, "¤¢¤¢¡Ä¥¦¡¼¥·¥å¥é¡Ä", 1);
                                                break;
                                }
                                break;
                        case M_PROTECT_TARGET:
                                if (*targetValue <= 0)
                                {
-                                       *completed = -2;
+                                       *completed = OB_JUST_FAILED;
                                        switch (game.area)
                                        {
                                                case MISN_NEROD:
-                                                       setRadioMessage(FACE_SID, "ÃÜÀ¸¡¢¥¯¥ê¥¹! Èà½÷¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¤¾!", 1);
+                                                       setRadioMessage(FS_SID, "ÃÜÀ¸¡¢¥¯¥ê¥¹! Èà½÷¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¤¾!", 1);
                                                        break;
                                                case MISN_ALLEZ:
-                                                       setRadioMessage(FACE_CREW, "¤¦¤ï¤¢¤¢!! Á¥ÂÎÇË¡Ä»¡Ä¡Ä", 1);
+                                                       setRadioMessage(FS_CREW, "¤¦¤ï¤¢¤¢!! Á¥ÂÎÇË¡Ä»¡Ä¡Ä", 1);
                                                        break;
                                                case MISN_URUSOR:
-                                                       setRadioMessage(FACE_SID, "¥¯¥ê¥¹¡¢¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¤ó¤À¡¢Ç˲õ¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤!!", 1);
+                                                       setRadioMessage(FS_SID, "¥¯¥ê¥¹¡¢¹Ò¹ÔÉÔǽ¤Ë¤¹¤ë¤ó¤À¡¢Ç˲õ¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤!!", 1);
                                                        break;
                                        }
                                }
@@ -405,7 +406,7 @@ static void evaluateRequirement(int type, int id, int *completed, int *targetVal
                        case M_DESTROY_TARGET_TYPE:
                                if ((*targetValue <= 10) || (*targetValue % 10 == 0))
                                {
-                                       if ((rand() % 2) == 0)
+                                       if (CHANCE(0.5))
                                                sprintf(message, "¤¢¤È %dÀÉ ¤À¡Ä", *targetValue);
                                        else
                                                sprintf(message, "%dÀÉ Ç˲õ¤·¤í¡Ä", *targetValue);
@@ -435,8 +436,8 @@ void updateMissionRequirements(int type, int id, int value)
        if ((type == M_DESTROY_TARGET_TYPE) && (id == CD_SID))
        {
                setInfoLine("¥·¥É¤Ï»à¤ó¤À!!", FONT_RED);
-               setRadioMessage(FACE_CHRIS, "¥·¥É¡¢¤¹¡Ä¤¹¤Þ¤ó¡Ä¡Ä", 1);
-               currentMission.completed1[0] = -2;
+               setRadioMessage(FS_CHRIS, "¥·¥É¡¢¤¹¡Ä¤¹¤Þ¤ó¡Ä¡Ä", 1);
+               currentMission.completed1[0] = OB_JUST_FAILED;
        }
 
        for (int i = 0 ; i < 3 ; i++)
@@ -444,8 +445,8 @@ void updateMissionRequirements(int type, int id, int value)
                if ((currentMission.completed1[i] == OB_INCOMPLETE) || (currentMission.completed1[i] == OB_CONDITION))
                {
                        if ((currentMission.primaryType[i] == type) &&
-                               ((currentMission.target1[i] == id) ||
-                                       (currentMission.target1[i] == CD_ANY)))
+                                       ((currentMission.target1[i] == id) ||
+                                               (currentMission.target1[i] == CD_ANY)))
                        {
                                matched = 1;
                                currentMission.targetValue1[i] -= value;
@@ -463,8 +464,8 @@ void updateMissionRequirements(int type, int id, int value)
                if ((currentMission.completed2[i] == OB_INCOMPLETE) || (currentMission.completed2[i] == OB_CONDITION))
                {
                        if ((currentMission.secondaryType[i] == type) &&
-                               ((currentMission.target2[i] == id) ||
-                                       (currentMission.target2[i] == CD_ANY)))
+                                       ((currentMission.target2[i] == id) ||
+                                               (currentMission.target2[i] == CD_ANY)))
                        {
                                currentMission.targetValue2[i] -= value;
                                evaluateRequirement(type, id, &currentMission.completed2[i], &currentMission.targetValue2[i], FONT_YELLOW);
@@ -497,7 +498,7 @@ void updateMissionRequirements(int type, int id, int value)
                {
                        setInfoLine("*** »îºîÀïÆ®µ¡¤òÇ˲õ - ºîÀﴰλ ***", FONT_GREEN);
                        systemPlanet[9].missionCompleted = 1;
-                       setRadioMessage(FACE_CHRIS, "WEAPCO¤Î´ñ½±¤Ê¤É¡¢¤¿¤¤¤·¤¿¤³¤È¤Ê¤¤¤Ê!", 1);
+                       setRadioMessage(FS_CHRIS, "WEAPCO¤Î´ñ½±¹¶·â¤Ê¤É¡¢¤¿¤¤¤·¤¿¤³¤È¤Ï¤Ê¤¤¤Ê!", 1);
                        game.experimentalShield = 0;
                }
        }
@@ -507,9 +508,9 @@ void updateMissionRequirements(int type, int id, int value)
 This is only used as few times in the game.
 Missions 11 and 23 to be exact!
 */
-static char revealHiddenObjectives()
+static int revealHiddenObjectives()
 {
-       char allDone = 1;
+       int allDone = 1;
        char string[255] = "";
 
        for (int i = 0 ; i < 3 ; i++)
@@ -529,7 +530,7 @@ static char revealHiddenObjectives()
                if (game.area == MISN_ELAMALE)
                {
                        mission_killAllEnemies();
-                       syncScriptEvents();
+                       events_sync();
                        aliens[ALIEN_KLINE].active = true;
                        aliens[ALIEN_KLINE].x = player.x + 1000;
                        aliens[ALIEN_KLINE].y = player.y;
@@ -550,7 +551,7 @@ bool allMissionsCompleted()
                {
                        if ((currentMission.primaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (currentMission.remainingObjectives1 + currentMission.remainingObjectives2 == 1))
                        {
-                               currentMission.completed1[i] = 2;
+                               currentMission.completed1[i] = OB_JUST_COMPLETED;
                                checkTimer();
                        }
                }
@@ -562,7 +563,7 @@ bool allMissionsCompleted()
                {
                        if ((currentMission.secondaryType[i] == M_DESTROY_ALL_TARGETS) && (engine.allAliensDead) && (currentMission.remainingObjectives1 + currentMission.remainingObjectives2 == 1))
                        {
-                               currentMission.completed2[i] = 2;
+                               currentMission.completed2[i] = OB_JUST_COMPLETED;
                                checkTimer();
                        }
                }
@@ -570,7 +571,7 @@ bool allMissionsCompleted()
 
        for (int i = 0 ; i < 3 ; i++)
        {
-               if (currentMission.completed1[i] == 2)
+               if (currentMission.completed1[i] == OB_JUST_COMPLETED)
                {
                        if (currentMission.remainingObjectives1 > 1)
                        {
@@ -585,7 +586,7 @@ bool allMissionsCompleted()
                                if (game.area != MISN_INTERCEPTION)
                                        setInfoLine("*** ¼çÍפÊǤ̳¤ò´°Î» ***", FONT_GREEN);
                                else
-                                       setInfoLine("*** ·Þ·âµ¡¤ò·âÇË ***", FONT_GREEN);
+                                       setInfoLine("*** ·Þ·âÉôÂâ¤ò·âÇË ***", FONT_GREEN);
                                currentMission.completed1[i] = OB_COMPLETED;
 
                                // do some area specific things
@@ -602,11 +603,11 @@ bool allMissionsCompleted()
                                }
 
                                if (game.area == MISN_EARTH)
-                                       setRadioMessage(FACE_CHRIS, "¤ªÁ°¤é¤Ï»Ä¤Ã¤Æ¤³¤³¤òÍÞ¤¨¤Æ¤¤¤Æ¤¯¤ì¡£²¶¤Ï¥±¥¹¥é¥ó¤òÄɤ¦!", 1);
+                                       setRadioMessage(FS_CHRIS, "¤³¤³¤òÍÞ¤¨¤Æ¤¤¤Æ¤¯¤ì¡£²¶¤Ï¥±¥¹¥é¥ó¤òÄɤ¦!", 1);
                        }
                }
 
-               if (currentMission.completed2[i] == 2)
+               if (currentMission.completed2[i] == OB_JUST_COMPLETED)
                {
                        if (currentMission.remainingObjectives2 > 1)
                        {
@@ -628,20 +629,20 @@ bool allMissionsCompleted()
                        }
                }
 
-               if (currentMission.completed1[i] == -2)
+               if (currentMission.completed1[i] == OB_JUST_FAILED)
                {
                        setInfoLine(">>> ºîÀZÇÔ <<<", FONT_RED);
                        currentMission.completed1[i] = OB_FAILED;
                }
 
-               if (currentMission.completed2[i] == -2)
+               if (currentMission.completed2[i] == OB_JUST_FAILED)
                {
                        setInfoLine(">>> Êä½õŪ¤ÊǤ̳¤ò¼ºÇÔ <<<", FONT_RED);
                        currentMission.completed2[i] = OB_FAILED;
                }
        }
 
-       signed char remaining;
+       int remaining;
        bool add = false;
        bool allDone = true;
 
@@ -650,9 +651,9 @@ bool allMissionsCompleted()
 
        for (int i = 0 ; i < 3 ; i++)
        {
-               if (currentMission.primaryType[i] != NONE)
+               if (currentMission.primaryType[i] != M_NONE)
                {
-                       if (currentMission.completed1[i] == 0)
+                       if (currentMission.completed1[i] == OB_INCOMPLETE)
                        {
                                currentMission.remainingObjectives1++;
                                if (currentMission.primaryType[i] == M_DESTROY_ALL_TARGETS)
@@ -660,12 +661,12 @@ bool allMissionsCompleted()
                                allDone = false;
                        }
 
-                       if (currentMission.completed1[i] < 0)
+                       if (currentMission.completed1[i] < OB_INCOMPLETE)
                                return false;
                }
-               if (currentMission.secondaryType[i] != NONE)
+               if (currentMission.secondaryType[i] != M_NONE)
                {
-                       if (currentMission.completed2[i] == 0)
+                       if (currentMission.completed2[i] == OB_INCOMPLETE)
                        {
                                currentMission.remainingObjectives2++;
                                if (currentMission.secondaryType[i] == M_DESTROY_ALL_TARGETS)
@@ -692,7 +693,7 @@ bool missionFailed()
 {
        for (int i = 0 ; i < 3 ; i++)
        {
-               if (currentMission.completed1[i] < 0)
+               if (currentMission.completed1[i] < OB_INCOMPLETE)
                {
                        return true;
                }
@@ -713,37 +714,37 @@ static void drawBriefScreen()
                SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, 0, i, 0));
        }
 
-       blevelRect(140, 70, 500, 20, 0x00, 0x77, 0x00);
-       blevelRect(140, 90, 500, 130, 0x00, 0x33, 0x00);
-       drawString("¼çÍפÊǤ̳", 150, 74, FONT_WHITE);
+       screen_drawRect(140, 70, 500, 20, 0x00, 0x77, 0x00);
+       screen_drawRect(140, 90, 500, 130, 0x00, 0x33, 0x00);
+       screen_renderString("¼çÍפÊǤ̳", 150, 74, FONT_WHITE);
 
        for (int i = 0 ; i < 3 ; i++)
        {
-               if ((currentMission.primaryType[i] != NONE) && (currentMission.completed1[i] != OB_HIDDEN))
+               if ((currentMission.primaryType[i] != M_NONE) && (currentMission.completed1[i] != OB_HIDDEN))
                {
-                       drawString(currentMission.primaryObjective[i], 160, 114 + (i * 30), FONT_WHITE);
+                       screen_renderString(currentMission.primaryObjective[i], 160, 114 + (i * 30), FONT_WHITE);
                }
        }
 
-       if (currentMission.secondaryType[0] != NONE)
+       if (currentMission.secondaryType[0] != M_NONE)
        {
-               blevelRect(140, 230, 500, 20, 0x00, 0x77, 0x77);
-               blevelRect(140, 250, 500, 130, 0x00, 0x33, 0x33);
-               drawString("Êä½õŪ¤ÊǤ̳", 150, 234, FONT_WHITE);
+               screen_drawRect(140, 230, 500, 20, 0x00, 0x77, 0x77);
+               screen_drawRect(140, 250, 500, 130, 0x00, 0x33, 0x33);
+               screen_renderString("Êä½õŪ¤ÊǤ̳", 150, 234, FONT_WHITE);
 
                for (int i = 0 ; i < 3 ; i++)
                {
-                       if (currentMission.secondaryType[i] != NONE)
+                       if (currentMission.secondaryType[i] != M_NONE)
                        {
-                               drawString(currentMission.secondaryObjective[i], 160, 274 + (i * 30), FONT_WHITE);
+                               screen_renderString(currentMission.secondaryObjective[i], 160, 274 + (i * 30), FONT_WHITE);
                                game.secondaryMissions++;
                        }
                }
        }
 
-       blevelRect(140, 390, 500, 20, 0x77, 0x77, 0x00);
-       blevelRect(140, 410, 500, 130, 0x33, 0x33, 0x00);
-       drawString("ÄɲäξðÊó", 150, 394, FONT_WHITE);
+       screen_drawRect(140, 390, 500, 20, 0x77, 0x77, 0x00);
+       screen_drawRect(140, 410, 500, 130, 0x33, 0x33, 0x00);
+       screen_renderString("ÄɲäξðÊó", 150, 394, FONT_WHITE);
 }
 
 /*
@@ -753,12 +754,12 @@ mission begins playing here.
 */
 void missionBriefScreen()
 {
-       clearScreen(black);
-       updateScreen();
+       screen_clear(black);
+       renderer_update();
 
        if (game.area != MISN_INTERCEPTION)
        {
-               clearScreen(black);
+               screen_clear(black);
                drawBriefScreen();
 
                if (currentMission.timeLimit1[0] > 0)
@@ -768,7 +769,7 @@ void missionBriefScreen()
                                sprintf(temp, "À©¸Â»þ´Ö: %dʬ", currentMission.timeLimit1[0]);
                        else
                                sprintf(temp, "%dʬ´Ö À¸¤­±ä¤Ó¤ë", currentMission.timeLimit1[0]);
-                       drawString(temp, -1, 500, FONT_RED);
+                       screen_renderString(temp, -1, 500, FONT_RED);
                }
 
                switch (game.area)
@@ -780,45 +781,48 @@ void missionBriefScreen()
                        case MISN_ELLESH:
                        case MISN_MARS:
                        case MISN_VENUS:
-                               drawString("¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹¤Ï»²²Ã¤·¤Ê¤¤", 160, 420, FONT_WHITE);
+                               screen_renderString("¥Õ¥§¡¼¥Ù¡¦¥ì¥Ã¥¯¥¹¤Ï»²²Ã¤·¤Ê¤¤", 160, 420, FONT_WHITE);
                                if (game.hasWingMate2)
-                                       drawString("¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹¤Ï»²²Ã¤·¤Ê¤¤", 160, 450, FONT_WHITE);
+                                       screen_renderString("¥¦¡¼¥·¥å¥é¡¦¥ì¥Ã¥¯¥¹¤Ï»²²Ã¤·¤Ê¤¤", 160, 450, FONT_WHITE);
                                break;
                }
 
                if ((game.area == MISN_URUSOR) ||
                                (game.area == MISN_POSWIC) ||
                                (game.area == MISN_EARTH))
-                       drawString("¥·¥É¡¦¥¦¥£¥ë¥½¥ó¤¬ºîÀï¤Ë»²²Ã¤¹¤ë", 160, 480, FONT_WHITE);
+                       screen_renderString("¥·¥É¡¦¥¦¥£¥ë¥½¥ó¤¬ºîÀï¤Ë»²²Ã¤¹¤ë", 160, 480, FONT_WHITE);
 
-               updateScreen();
+               renderer_update();
        }
 
        loadGameGraphics();
-       textSurface(4, "\8e¼\8e°\8eÙ\8eÄ\8eÞ", 25, 550, FONT_WHITE);
-       textSurface(5, "\8eÌ\8eß\8e×\8e½\8eÞ\8eÏ:", 250, 550, FONT_WHITE);
+       gfx_createTextObject(TS_SHIELD, "\8e¼\8e°\8eÙ\8eÄ\8eÞ", screen->w / 32, screen->h - 50, FONT_WHITE);
+       gfx_createTextObject(TS_PLASMA_T, "\8eÌ\8eß\8e×\8e½\8eÞ\8eÏ:", screen->w * 5 / 16, screen->h - 50, FONT_WHITE);
 
        if (player.weaponType[1] == W_CHARGER)
-               textSurface(6, "\8eÁ\8e¬\8e°\8e¼\8eÞ", 385, 550, FONT_WHITE);
+               gfx_createTextObject(TS_AMMO_T, "\8eÁ\8e¬\8e°\8e¼\8eÞ", screen->w / 2, screen->h - 50, FONT_WHITE);
        else if (player.weaponType[1] == W_LASER)
-               textSurface(6, "\8eµ\8eÝ\8eÄ\8eÞ", 405, 550, FONT_WHITE);
+               gfx_createTextObject(TS_AMMO_T, "\8eµ\8eÝ\8eÄ\8eÞ", screen->w / 2 + 20, screen->h - 50, FONT_WHITE);
        else
-               textSurface(6, "\8eÛ\8e¹\8e¯\8eÄ:", 385, 550, FONT_WHITE);
-
-       textSurface(7, "\8eÀ\8e°\8e¹\8eÞ\8e¯\8eÄ", 550, 550, FONT_WHITE);
-       textSurface(8, "\8e·\8e¬\8e¯\8e¼\8e­: $", 25, 20, FONT_WHITE);
-       textSurface(9, "\8eÉ\8eº\8eØ \8eÉ \8e»\8e¸\8e¾\8eÝ:", 550, 20, FONT_WHITE);
-       textSurface(10, "\8eÉ\8eº\8eØ\8e¼\8eÞ\8e\8eÝ - ", 260, 20, FONT_WHITE);
-       textSurface(11, "\8e\8eØ\8e®\8e¸", 25, 570, FONT_WHITE);
-       textSurface(12, "\8eÊ\8eÝ\8e²", 250, 570, FONT_WHITE);
-       textSurface(13, "\8eÚ\8eÝ\8e¼\8e¬\8e¿\8e¸\8eÄ\8eÞ", 485, 570, FONT_WHITE);
+               gfx_createTextObject(TS_AMMO_T, "\8eÛ\8e¹\8e¯\8eÄ:", screen->w / 2, screen->h - 50, FONT_WHITE);
+
+       gfx_createTextObject(TS_TARGET, "\8eÀ\8e°\8e¹\8eÞ\8e¯\8eÄ", screen->w * 11 / 16, screen->h - 50, FONT_WHITE);
+       gfx_createTextObject(TS_TARGET_SID, "\8e¼\8eÄ\8eÞ", screen->w * 11 / 16 + 27, screen->h - 50, FONT_WHITE);
+       gfx_createTextObject(TS_TARGET_PHOEBE, "\8eÌ\8eª\8e°\8eÍ\8eÞ", screen->w * 11 / 16, screen->h - 50, FONT_WHITE);
+       gfx_createTextObject(TS_TARGET_KLINE, "\8e¹\8e½\8e×\8eÝ", screen->w * 11 / 16 + 9, screen->h - 50, FONT_WHITE);
+       gfx_createTextObject(TS_CASH_T, "\8e·\8e¬\8e¯\8e¼\8e­: $", 25, 20, FONT_WHITE);
+       gfx_createTextObject(TS_OBJECTIVES_T, "\8eÉ\8eº\8eØ \8eÉ \8e»\8e¸\8e¾\8eÝ:", screen->w - 250, 20, FONT_WHITE);
+       gfx_createTextObject(TS_TIME_T, "\8eÉ\8eº\8eØ\8e¼\8eÞ\8e\8eÝ - ", screen->w / 2 - 140, 20, FONT_WHITE);
+       gfx_createTextObject(TS_POWER, "\8e\8eØ\8e®\8e¸", screen->w / 32, screen->h - 30, FONT_WHITE);
+       gfx_createTextObject(TS_OUTPUT, "\8eÊ\8eÝ\8e²", screen->w * 5 / 16, screen->h - 30, FONT_WHITE);
+       gfx_createTextObject(TS_COOLER, "\8eÚ\8eÝ\8e¼\8e¬\8e¿\8e¸\8eÄ\8eÞ", screen->w * 97 / 160, screen->h - 30, FONT_WHITE);
        audio_playRandomTrack();
 
        if (game.area != MISN_INTERCEPTION)
        {
-               drawString("ENTER¥­¡¼¤ò²¡¤¹¤È³¤±¤ë¡Ä", -1, 550, FONT_WHITE);
+               screen_renderString("ENTER¥­¡¼¤ò²¡¤¹¤È³¤±¤ë¡Ä", -1, 550, FONT_WHITE);
 
-               updateScreen();
+               renderer_update();
 
                flushInput();
                engine.done = 0;
@@ -828,16 +832,16 @@ void missionBriefScreen()
 
                while (true)
                {
-                       delayFrame();
+                       game_delayFrame();
                        getPlayerInput();
                        if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) ||
                                        (engine.keyState[KEY_ESCAPE]))
                                break;
                }
 
-               clearScreen(black);
-               updateScreen();
-               clearScreen(black);
+               screen_clear(black);
+               renderer_update();
+               screen_clear(black);
        }
 
        engine.gameSection = SECTION_GAME;
@@ -856,41 +860,41 @@ void missionFinishedScreen()
 
        if (game.area != MISN_INTERCEPTION)
        {
-               clearScreen(black);
-               updateScreen();
+               screen_clear(black);
+               renderer_update();
 
                if (game.shots > 0)
                        game.accuracy = (game.hits * 100) / game.shots;
 
-               clearScreen(black);
+               screen_clear(black);
                drawBriefScreen();
 
                for (int i = 0 ; i < 3 ; i++)
                {
-                       if (currentMission.primaryType[i] != NONE)
+                       if (currentMission.primaryType[i] != M_NONE)
                        {
                                if ((game.area != MISN_POSWIC) || (i != 1))
-                                       drawString("COMPLETED", 550, 114 + (i * 30), FONT_GREEN);
+                                       screen_renderString("COMPLETED", 550, 114 + (i * 30), FONT_GREEN);
                                else
-                                       drawString("FAILED", 550, 114 + (i * 30), FONT_RED);
+                                       screen_renderString("FAILED", 550, 114 + (i * 30), FONT_RED);
                        }
                }
 
-               if (currentMission.secondaryType[0] != NONE)
+               if (currentMission.secondaryType[0] != M_NONE)
                {
                        for (int i = 0 ; i < 3 ; i++)
                        {
-                               if (currentMission.secondaryType[i] != NONE)
+                               if (currentMission.secondaryType[i] != M_NONE)
                                {
                                        strcpy(temp, currentMission.secondaryObjective[i]);
-                                       if (currentMission.completed2[i] >= 1)
+                                       if (currentMission.completed2[i] >= OB_COMPLETED)
                                        {
-                                               drawString("COMPLETED", 550, 274 + (i * 30), FONT_GREEN);
+                                               screen_renderString("COMPLETED", 550, 274 + (i * 30), FONT_GREEN);
                                                game.secondaryMissionsCompleted++;
                                        }
                                        else
                                        {
-                                               drawString("FAILED", 550, 274 + (i * 30), FONT_RED);
+                                               screen_renderString("FAILED", 550, 274 + (i * 30), FONT_RED);
                                        }
                                }
                        }
@@ -900,7 +904,7 @@ void missionFinishedScreen()
                {
                        shield_bonus = player.shield * 10;
                        sprintf(temp, "¥·¡¼¥ë¥É ¥Ü¡¼¥Ê¥¹: $%.3d", shield_bonus);
-                       drawString(temp, -1, 430, FONT_WHITE);
+                       screen_renderString(temp, -1, 430, FONT_WHITE);
                        game.cash += shield_bonus;
                        game.cashEarned += shield_bonus;
                }
@@ -911,7 +915,7 @@ void missionFinishedScreen()
                        engine.timeTaken / 3600, (engine.timeTaken / 60) % 60,
                        engine.timeTaken % 60);
 
-               drawString(temp, -1, 500, FONT_WHITE);
+               screen_renderString(temp, -1, 500, FONT_WHITE);
 
                // Do some mission specific stuff here...
                if (game.area == MISN_HAIL)
@@ -923,7 +927,7 @@ void missionFinishedScreen()
 
                checkForBossMission();
 
-               updateScreen();
+               renderer_update();
 
                flushInput();
                engine.done = 0;
@@ -931,7 +935,7 @@ void missionFinishedScreen()
 
                while (true)
                {
-                       delayFrame();
+                       game_delayFrame();
                        getPlayerInput();
                        if ((engine.keyState[KEY_FIRE]))
                                break;
@@ -996,7 +1000,7 @@ void initMissions()
        missions[MISN_CERADSE].completed1[1] = OB_CONDITION;
 
        sprintf(missions[MISN_CERADSE].secondaryObjective[0],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_CERADSE].secondaryType[0] = M_DESTROY_ALL_TARGETS;
        missions[MISN_CERADSE].completed2[0] = OB_INCOMPLETE;
 
@@ -1004,14 +1008,14 @@ void initMissions()
 
 
        sprintf(missions[MISN_HINSTAG].primaryObjective[0],
-               "5ÀɤÎWEPCO¤Î¥ß¥µ¥¤¥ëÄú¤òÇ˲õ¤¹¤ë");
+               "5ÀɤÎWEAPCO¤Î¥ß¥µ¥¤¥ëÄú¤òÇ˲õ¤¹¤ë");
        missions[MISN_HINSTAG].primaryType[0] = M_DESTROY_TARGET_TYPE;
        missions[MISN_HINSTAG].target1[0] = CD_MISSILEBOAT;
        missions[MISN_HINSTAG].targetValue1[0] = 5;
        missions[MISN_HINSTAG].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_HINSTAG].secondaryObjective[0],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_HINSTAG].secondaryType[0] = M_DESTROY_ALL_TARGETS;
        missions[MISN_HINSTAG].completed2[0] = OB_INCOMPLETE;
 
@@ -1026,7 +1030,7 @@ void initMissions()
        missions[MISN_JOLDAR].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_JOLDAR].secondaryObjective[0],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_JOLDAR].secondaryType[0] = M_DESTROY_ALL_TARGETS;
        missions[MISN_JOLDAR].completed2[0] = OB_INCOMPLETE;
 
@@ -1059,7 +1063,7 @@ void initMissions()
        missions[MISN_NEROD].completed1[1] = OB_CONDITION;
 
        sprintf(missions[MISN_NEROD].primaryObjective[2],
-               "WEPCO¤Î·³ÃĤò·âÇˤ¹¤ë");
+               "WEAPCO¤Î·³ÃĤò·âÇˤ¹¤ë");
        missions[MISN_NEROD].primaryType[2] = M_DESTROY_TARGET_TYPE;
        missions[MISN_NEROD].target1[2] = CD_ANY;
        missions[MISN_NEROD].targetValue1[2] = 35;
@@ -1083,7 +1087,7 @@ void initMissions()
        missions[MISN_ALLEZ].completed1[1] = OB_CONDITION;
        
        sprintf(missions[MISN_ALLEZ].secondaryObjective[0],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_ALLEZ].secondaryType[0] = M_DESTROY_ALL_TARGETS;
        missions[MISN_ALLEZ].completed2[0] = OB_INCOMPLETE;
 
@@ -1098,7 +1102,7 @@ void initMissions()
        missions[MISN_URUSOR].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_URUSOR].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_URUSOR].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_URUSOR].completed1[1] = OB_INCOMPLETE;
 
@@ -1140,7 +1144,7 @@ void initMissions()
 
 
        sprintf(missions[MISN_ELAMALE].primaryObjective[0],
-               "WEPCO¤ÎºÎ·¡Á¥¤òÇ˲õ¤¹¤ë");
+               "WEAPCO¤ÎºÎ·¡Á¥¤òÇ˲õ¤¹¤ë");
        missions[MISN_ELAMALE].primaryType[0] = M_DESTROY_TARGET_TYPE;
        missions[MISN_ELAMALE].target1[0] = CD_BOSS;
        missions[MISN_ELAMALE].targetValue1[0] = 1;
@@ -1181,7 +1185,7 @@ void initMissions()
        missions[MISN_ODEON].completed1[2] = OB_CONDITION;
 
        sprintf(missions[MISN_ODEON].secondaryObjective[0],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_ODEON].secondaryType[0] = M_DESTROY_ALL_TARGETS;
        missions[MISN_ODEON].completed2[0] = OB_INCOMPLETE;
 
@@ -1196,7 +1200,7 @@ void initMissions()
        missions[MISN_FELLON].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_FELLON].primaryObjective[1],
-               "¾¯¤Ê¤¯¤È¤â1ÀɤβòÊü·³¤Î´ÏÁ¥¤¬À¸¤­»Ä¤ë");
+               "¾¯¤Ê¤¯¤È¤â1ÀɤÎÈ¿Í𷳤δÏÁ¥¤¬À¸¤­»Ä¤ë");
        missions[MISN_FELLON].primaryType[1] = M_PROTECT_TARGET;
        missions[MISN_FELLON].target1[1] = CD_REBELCARRIER;
        missions[MISN_FELLON].targetValue1[1] = 2;
@@ -1235,7 +1239,7 @@ void initMissions()
        missions[MISN_ALMARTHA].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_ALMARTHA].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_ALMARTHA].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_ALMARTHA].completed1[1] = OB_INCOMPLETE;
 
@@ -1249,14 +1253,14 @@ void initMissions()
        missions[MISN_POSWIC].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_POSWIC].primaryObjective[1],
-               "½ÅÌò¤ÎÈÂÁ÷¤òÁ˻ߤ¹¤ë");
+               "½ÅÌò¤Î°ÜÁ÷¤òÁ˻ߤ¹¤ë");
        missions[MISN_POSWIC].primaryType[1] = M_ESCAPE_TARGET;
        missions[MISN_POSWIC].target1[1] = CD_BOSS;
        missions[MISN_POSWIC].targetValue1[1] = 1;
        missions[MISN_POSWIC].completed1[1] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_POSWIC].primaryObjective[2],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_POSWIC].primaryType[2] = M_DESTROY_ALL_TARGETS;
        missions[MISN_POSWIC].completed1[2] = OB_INCOMPLETE;
 
@@ -1264,7 +1268,7 @@ void initMissions()
 
 
        sprintf(missions[MISN_ELLESH].primaryObjective[0],
-               "½ÅÌò¤ÎÈÂÁ÷Á¥¤òÇ˲õ¤¹¤ë");
+               "½ÅÌò¤Î°ÜÁ÷Á¥¤òÇ˲õ¤¹¤ë");
        missions[MISN_ELLESH].primaryType[0] = M_DESTROY_TARGET_TYPE;
        missions[MISN_ELLESH].target1[0] = CD_BOSS;
        missions[MISN_ELLESH].targetValue1[0] = 1;
@@ -1281,7 +1285,7 @@ void initMissions()
        missions[MISN_PLUTO].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_PLUTO].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_PLUTO].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_PLUTO].completed1[1] = OB_INCOMPLETE;
 
@@ -1299,7 +1303,7 @@ void initMissions()
        missions[MISN_NEPTUNE].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_NEPTUNE].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_NEPTUNE].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_NEPTUNE].completed1[1] = OB_INCOMPLETE;
 
@@ -1317,7 +1321,7 @@ void initMissions()
        missions[MISN_URANUS].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_URANUS].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤ÎÀïÆ®µ¡¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_URANUS].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_URANUS].completed1[1] = OB_INCOMPLETE;
 
@@ -1335,7 +1339,7 @@ void initMissions()
        missions[MISN_SATURN].completed1[0] = OB_INCOMPLETE;
 
        sprintf(missions[MISN_SATURN].primaryObjective[1],
-               "»Ä¸¤¹¤ëWEPCO¤Î´ÏÁ¥¤òÁ´¤ÆÇ˲õ¤¹¤ë");
+               "»Ä¸¤¹¤ëWEAPCO¤Î´ÏÁ¥¤òÁ´¤ÆÇ˲õ¤¹¤ë");
        missions[MISN_SATURN].primaryType[1] = M_DESTROY_ALL_TARGETS;
        missions[MISN_SATURN].completed1[1] = OB_INCOMPLETE;
 
@@ -1354,7 +1358,7 @@ void initMissions()
        missions[MISN_JUPITER].completed1[1] = OB_HIDDEN;
 
        sprintf(missions[MISN_JUPITER].primaryObjective[2],
-               "¥¿¥¤¥é¡¼¤Î»Ù±ç¼Ô¤òÅݤ¹");
+               "¥¯¥é¥¹¤Î»Ù±ç¼Ô¤òÅݤ¹");
        missions[MISN_JUPITER].primaryType[2] = M_DESTROY_ALL_TARGETS;
        missions[MISN_JUPITER].target1[1] = CD_FIREFLY;
        missions[MISN_JUPITER].targetValue1[1] = 4;
@@ -1363,7 +1367,7 @@ void initMissions()
        missions[MISN_JUPITER].addAliens = ALWAYS;
 
 
-       sprintf(missions[MISN_MARS].primaryObjective[0], "¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤ò¿Ê¤à");
+       sprintf(missions[MISN_MARS].primaryObjective[0], "¥¢¥¹¥Æ¥í¥¤¥É¥Ù¥ë¥È¤ò¹Ò¹Ô¤¹¤ë");
        missions[MISN_MARS].primaryType[0] = M_DESTROY_TARGET_TYPE;
        missions[MISN_MARS].target1[0] = CD_BOSS;
        missions[MISN_MARS].targetValue1[0] = 1;
index e7f4008..7cb313b 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern Planet systemPlanet[10];
 extern mission currentMission;
 
-extern void initPlanetMissions(signed char system);
+extern void initPlanetMissions(int system);
 extern void checkForBossMission();
 extern void updateSystemStatus();
 extern void setMission(int mission);
index 188cbe1..27ae2e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -34,8 +34,8 @@ void initPlayer()
        player.systemPower = player.maxShield;
        player.face = 0;
 
-       player.image[0] = shipShape[0];
-       player.image[1] = shipShape[1];
+       player.image[0] = gfx_shipSprites[SS_FIREFLY];
+       player.image[1] = gfx_shipSprites[SS_FIREFLY_L];
 
        player.engineX = player.image[0]->w;
        player.engineY = (player.image[0]->h / 2);
@@ -270,8 +270,11 @@ void getPlayerInput()
        {
                // Get the current mouse position
                static int px = -1, py = -1;
-               int x, y;
+               int x, y, w, h;
                SDL_GetMouseState(&x, &y);
+               SDL_GetWindowSize(window, &w, &h);
+               x = screen->w * x / w;
+               y = screen->h * y / h;
                if (px == x && py == y) {
                        if(engine.keyState[KEY_UP] && engine.cursor_y > 0)
                                engine.cursor_y -= 4;
@@ -317,7 +320,7 @@ void leaveSector()
                if (player.x <= -100)
                {
                        engine.done = 2;
-                       audio_playSound(SFX_FLY, screen->w / 2);
+                       audio_playSound(SFX_FLY, screen->w / 2, screen->h / 2);
                }
        }
 
index 0f70ada..5e55417 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
diff --git a/src/renderer.cpp b/src/renderer.cpp
new file mode 100644 (file)
index 0000000..cd46d81
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2015 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "SDL.h"
+
+#include "screen.h"
+
+SDL_Renderer *renderer;
+SDL_Texture *renderer_texture;
+
+void renderer_update()
+{
+       // XXX: The SDL wiki says that SDL_UpdateTexture is slow and shouldn't
+       // be used for textures that are updated often. This should be looked
+       // into.
+       SDL_UpdateTexture(renderer_texture, NULL, screen->pixels, screen->w * 4);
+       SDL_RenderCopy(renderer, renderer_texture, NULL, NULL);
+       SDL_RenderPresent(renderer);
+}
similarity index 77%
rename from src/script.h
rename to src/renderer.h
index 29ec9ec..19de26e 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef SCRIPT_H
-#define SCRIPT_H
+#ifndef RENDERER_H
+#define RENDERER_H
 
-extern void loadScriptEvents();
-extern void checkScriptEvents();
-extern void syncScriptEvents();
-extern void doCutscene(int scene);
+extern SDL_Renderer *renderer;
+extern SDL_Texture *renderer_texture;
+
+void renderer_update();
 
 #endif
index 09ead65..6ff1229 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -21,135 +21,242 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 void loadBackground(const char *filename)
 {
-       if (background != NULL)
+       if (gfx_background != NULL)
        {
-               SDL_FreeSurface(background);
-               background = NULL;
+               SDL_FreeSurface(gfx_background);
+               gfx_background = NULL;
        }
-       background = loadImage(filename);
-       SDL_SetColorKey(background, 0, 0);
+       gfx_background = gfx_loadImage(filename);
+       SDL_SetColorKey(gfx_background, 0, 0);
 }
 
 void loadGameGraphics()
 {
-       int index;
-       char string[75] = "";
-       FILE *fp;
        Uint32 *p32;
        Uint16 *p16;
        Uint8 *p8;
 
-       freeGraphics();
-
-       shipShape[0] = loadImage("gfx/firefly1.png");
-       shipShape[1] = loadImage("gfx/firefly2.png");
-
-       switch(game.system)
-       {
-               case 0:
-                       strcpy(string, "data/resources_spirit.dat");
-                       break;
-               case 1:
-                       strcpy(string, "data/resources_eyananth.dat");
-                       break;
-               case 2:
-                       strcpy(string, "data/resources_mordor.dat");
-                       break;
-               case 3:
-                       strcpy(string, "data/resources_sol.dat");
-                       break;
-       }
-
-       fp = fopen(string, "rb");
-
-       if (fp == NULL)
-               exit(1);
-
-       while (fscanf(fp, "%d %s", &index, string) == 2)
-       {
-               shipShape[index] = loadImage(string);
-       }
-
-       fclose(fp);
+       gfx_free();
+
+       // Faces
+       gfx_faceSprites[FS_CHRIS] = gfx_loadImage("gfx/face_chris.png");
+       gfx_faceSprites[FS_SID] = gfx_loadImage("gfx/face_sid.png");
+       gfx_faceSprites[FS_KRASS] = gfx_loadImage("gfx/face_krass.png");
+       gfx_faceSprites[FS_PHOEBE] = gfx_loadImage("gfx/face_phoebe.png");
+       gfx_faceSprites[FS_URSULA] = gfx_loadImage("gfx/face_ursula.png");
+       gfx_faceSprites[FS_KLINE] = gfx_loadImage("gfx/face_kline.png");
+       gfx_faceSprites[FS_CREW] = gfx_loadImage("gfx/face_crew.png");
+
+       // Ships
+       gfx_shipSprites[SS_FIREFLY] = gfx_loadImage("gfx/firefly1.png");
+       gfx_shipSprites[SS_FIREFLY_L] = gfx_loadImage("gfx/firefly2.png");
+       gfx_shipSprites[SS_SID] = gfx_loadImage("gfx/sid1.png");
+       gfx_shipSprites[SS_SID_L] = gfx_loadImage("gfx/sid2.png");
+       gfx_shipSprites[SS_FRIEND] = gfx_loadImage("gfx/wingmate1.png");
+       gfx_shipSprites[SS_FRIEND_L] = gfx_loadImage("gfx/wingmate2.png");
+       gfx_shipSprites[SS_GOODTRANSPORT] = gfx_loadImage("gfx/goodTrans1.png");
+       gfx_shipSprites[SS_GOODTRANSPORT_L] = gfx_loadImage("gfx/goodTrans2.png");
+       gfx_shipSprites[SS_REBELCARRIER] = gfx_loadImage("gfx/rebelCarrier1.png");
+       gfx_shipSprites[SS_REBELCARRIER_L] = gfx_loadImage("gfx/rebelCarrier2.png");
+       gfx_shipSprites[SS_DUALFIGHTER] = gfx_loadImage("gfx/dualFighter1.png");
+       gfx_shipSprites[SS_DUALFIGHTER_L] = gfx_loadImage("gfx/dualFighter2.png");
+       gfx_shipSprites[SS_MISSILEBOAT] = gfx_loadImage("gfx/missileBoat1.png");
+       gfx_shipSprites[SS_MISSILEBOAT_L] = gfx_loadImage("gfx/missileBoat2.png");
+       gfx_shipSprites[SS_PROTOFIGHTER] = gfx_loadImage("gfx/eliteFighter1.png");
+       gfx_shipSprites[SS_PROTOFIGHTER_L] = gfx_loadImage("gfx/eliteFighter2.png");
+       gfx_shipSprites[SS_AIMFIGHTER] = gfx_loadImage("gfx/aimFighter1.png");
+       gfx_shipSprites[SS_AIMFIGHTER_L] = gfx_loadImage("gfx/aimFighter2.png");
+       gfx_shipSprites[SS_DRONE] = gfx_loadImage("gfx/drone1.png");
+       gfx_shipSprites[SS_DRONE_L] = gfx_loadImage("gfx/drone2.png");
+       gfx_shipSprites[SS_MINER] = gfx_loadImage("gfx/miner1.png");
+       gfx_shipSprites[SS_MINER_L] = gfx_loadImage("gfx/miner2.png");
+       gfx_shipSprites[SS_ESCORT] = gfx_loadImage("gfx/escort1.png");
+       gfx_shipSprites[SS_ESCORT_L] = gfx_loadImage("gfx/escort2.png");
+       gfx_shipSprites[SS_MOBILE_RAY] = gfx_loadImage("gfx/mobileCannon1.png");
+       gfx_shipSprites[SS_MOBILE_RAY_L] = gfx_loadImage("gfx/mobileCannon2.png");
+       gfx_shipSprites[SS_TRANSPORTSHIP] = gfx_loadImage("gfx/transport1.png");
+       gfx_shipSprites[SS_TRANSPORTSHIP_L] = gfx_loadImage("gfx/transport2.png");
+       gfx_shipSprites[SS_CARGOSHIP] = gfx_loadImage("gfx/tug1.png");
+       gfx_shipSprites[SS_CARGOSHIP_L] = gfx_loadImage("gfx/tug2.png");
+       gfx_shipSprites[SS_SLAVETRANSPORT] = gfx_loadImage("gfx/slaveTrans1.png");
+       gfx_shipSprites[SS_SLAVETRANSPORT_L] = gfx_loadImage("gfx/slaveTrans2.png");
+       gfx_shipSprites[SS_BARRIER] = gfx_loadImage("gfx/barrier.png");
+       gfx_shipSprites[SS_MOBILESHIELD] = gfx_loadImage("gfx/mobileShield1.png");
+       gfx_shipSprites[SS_MOBILESHIELD_L] = gfx_loadImage("gfx/mobileShield2.png");
+       gfx_shipSprites[SS_ASTEROID] = gfx_loadImage("gfx/asteroid1.png");
+       gfx_shipSprites[SS_ASTEROID_SMALL] = gfx_loadImage("gfx/asteroid2.png");
+       gfx_shipSprites[SS_ASTEROID_SMALL_L] = gfx_loadImage("gfx/asteroid3.png");
+       gfx_shipSprites[SS_CLOAKFIGHTER] = gfx_loadImage("gfx/cloakShip1.png");
+       gfx_shipSprites[SS_CLOAKFIGHTER_L] = gfx_loadImage("gfx/cloakShip2.png");
+       gfx_shipSprites[SS_EVILURSULA] = gfx_loadImage("gfx/evilUrsula1.png");
+       gfx_shipSprites[SS_EVILURSULA_L] = gfx_loadImage("gfx/evilUrsula2.png");
+       gfx_shipSprites[SS_KRASS] = gfx_loadImage("gfx/merc1.png");
+       gfx_shipSprites[SS_KRASS_L] = gfx_loadImage("gfx/merc2.png");
+       gfx_shipSprites[SS_FRIGATE] = gfx_loadImage("gfx/frigateBody1.png");
+       gfx_shipSprites[SS_FRIGATE_L] = gfx_loadImage("gfx/frigateBody2.png");
+       gfx_shipSprites[SS_FRIGATE_WING1] = gfx_loadImage("gfx/frigateGun11.png");
+       gfx_shipSprites[SS_FRIGATE_WING1_L] = gfx_loadImage("gfx/frigateGun12.png");
+       gfx_shipSprites[SS_FRIGATE_WING2] = gfx_loadImage("gfx/frigateGun21.png");
+       gfx_shipSprites[SS_FRIGATE_WING2_L] = gfx_loadImage("gfx/frigateGun22.png");
+       gfx_shipSprites[SS_MINERBOSS] = gfx_loadImage("gfx/mineBoss1.png");
+       gfx_shipSprites[SS_MINERBOSS_L] = gfx_loadImage("gfx/mineBoss2.png");
+       gfx_shipSprites[SS_MINERBOSS_WING1] = gfx_loadImage("gfx/mineBossWing11.png");
+       gfx_shipSprites[SS_MINERBOSS_WING1_L] = gfx_loadImage("gfx/mineBossWing12.png");
+       gfx_shipSprites[SS_MINERBOSS_WING2] = gfx_loadImage("gfx/mineBossWing21.png");
+       gfx_shipSprites[SS_MINERBOSS_WING2_L] = gfx_loadImage("gfx/mineBossWing22.png");
+       gfx_shipSprites[SS_MINERBOSS_WING3] = gfx_loadImage("gfx/mineBossWing31.png");
+       gfx_shipSprites[SS_MINERBOSS_WING3_L] = gfx_loadImage("gfx/mineBossWing32.png");
+       gfx_shipSprites[SS_MINERBOSS_WING4] = gfx_loadImage("gfx/mineBossWing41.png");
+       gfx_shipSprites[SS_MINERBOSS_WING4_L] = gfx_loadImage("gfx/mineBossWing42.png");
+       gfx_shipSprites[SS_EXEC] = gfx_loadImage("gfx/execTrans1.png");
+       gfx_shipSprites[SS_EXEC_L] = gfx_loadImage("gfx/execTrans2.png");
+       gfx_shipSprites[SS_PLUTOBOSS] = gfx_loadImage("gfx/plutoBoss1.png");
+       gfx_shipSprites[SS_PLUTOBOSS_L] = gfx_loadImage("gfx/plutoBoss2.png");
+       gfx_shipSprites[SS_URANUSBOSS] = gfx_loadImage("gfx/splitBoss11.png");
+       gfx_shipSprites[SS_URANUSBOSS_L] = gfx_loadImage("gfx/splitBoss12.png");
+       gfx_shipSprites[SS_URANUSBOSS_WING1] = gfx_loadImage("gfx/splitBoss21.png");
+       gfx_shipSprites[SS_URANUSBOSS_WING1_L] = gfx_loadImage("gfx/splitBoss22.png");
+       gfx_shipSprites[SS_URANUSBOSS_WING2] = gfx_loadImage("gfx/splitBoss31.png");
+       gfx_shipSprites[SS_URANUSBOSS_WING2_L] = gfx_loadImage("gfx/splitBoss32.png");
+       gfx_shipSprites[SS_KLINE] = gfx_loadImage("gfx/kline11.png");
+       gfx_shipSprites[SS_KLINE_L] = gfx_loadImage("gfx/kline12.png");
 
        /*
        Create images of ships being hit that show a lot of red
        */
-       for (int i = SHIP_HIT_INDEX ; i < MAX_SHIPSHAPES ; i++)
+       for (int i = SS_HIT_INDEX ; i < SS_MAX ; i++)
        {
-               if (shipShape[i - SHIP_HIT_INDEX] == NULL)
+               if (gfx_shipSprites[i - SS_HIT_INDEX] == NULL)
                        continue;
-               shipShape[i] = createSurface(shipShape[i - SHIP_HIT_INDEX]->w,
-                       shipShape[i - SHIP_HIT_INDEX]->h);
-               SDL_SetSurfaceBlendMode(shipShape[i - SHIP_HIT_INDEX], SDL_BLENDMODE_NONE);
-               blit(shipShape[i - SHIP_HIT_INDEX], 0, 0, shipShape[i]);
-               SDL_SetSurfaceBlendMode(shipShape[i - SHIP_HIT_INDEX], SDL_BLENDMODE_BLEND);
+               gfx_shipSprites[i] = gfx_createSurface(gfx_shipSprites[i - SS_HIT_INDEX]->w,
+                       gfx_shipSprites[i - SS_HIT_INDEX]->h);
+               SDL_SetSurfaceBlendMode(gfx_shipSprites[i - SS_HIT_INDEX], SDL_BLENDMODE_NONE);
+               gfx_blit(gfx_shipSprites[i - SS_HIT_INDEX], 0, 0, gfx_shipSprites[i]);
+               SDL_SetSurfaceBlendMode(gfx_shipSprites[i - SS_HIT_INDEX], SDL_BLENDMODE_BLEND);
 
-               switch (shipShape[i]->format->BitsPerPixel)
+               switch (gfx_shipSprites[i]->format->BitsPerPixel)
                {
                        case 32:
-                               SDL_LockSurface(shipShape[i]);
-                               p32 = (Uint32 *)shipShape[i]->pixels;
-                               for (int j = 0; j < shipShape[i]->w * shipShape[i]->h; j++)
+                               SDL_LockSurface(gfx_shipSprites[i]);
+                               p32 = (Uint32 *)gfx_shipSprites[i]->pixels;
+                               for (int j = 0; j < gfx_shipSprites[i]->w * gfx_shipSprites[i]->h; j++)
                                {
                                        if (p32[j])
-                                               p32[j] |= shipShape[i]->format->Rmask;
+                                               p32[j] |= gfx_shipSprites[i]->format->Rmask;
                                }
-                               SDL_UnlockSurface(shipShape[i]);
+                               SDL_UnlockSurface(gfx_shipSprites[i]);
                                break;
 
                        case 16:
-                               SDL_LockSurface(shipShape[i]);
-                               p16 = (Uint16 *)shipShape[i]->pixels;
-                               for (int j = 0; j < shipShape[i]->w * shipShape[i]->h; j++)
+                               SDL_LockSurface(gfx_shipSprites[i]);
+                               p16 = (Uint16 *)gfx_shipSprites[i]->pixels;
+                               for (int j = 0; j < gfx_shipSprites[i]->w * gfx_shipSprites[i]->h; j++)
                                {
                                        if (p16[j])
-                                               p16[j] |= shipShape[i]->format->Rmask;
+                                               p16[j] |= gfx_shipSprites[i]->format->Rmask;
                                }
-                               SDL_UnlockSurface(shipShape[i]);
+                               SDL_UnlockSurface(gfx_shipSprites[i]);
                                break;
 
                        case 8:
-                               SDL_LockSurface(shipShape[i]);
-                               p8 = (Uint8 *)shipShape[i]->pixels;
-                               for (int j = 0; j < shipShape[i]->w * shipShape[i]->h; j++)
+                               SDL_LockSurface(gfx_shipSprites[i]);
+                               p8 = (Uint8 *)gfx_shipSprites[i]->pixels;
+                               for (int j = 0; j < gfx_shipSprites[i]->w * gfx_shipSprites[i]->h; j++)
                                {
                                        if (p8[j])
-                                               p8[j] = SDL_MapRGB(shipShape[i]->format, 255, 0, 0);
+                                               p8[j] = SDL_MapRGB(gfx_shipSprites[i]->format, 255, 0, 0);
                                }
-                               SDL_UnlockSurface(shipShape[i]);
+                               SDL_UnlockSurface(gfx_shipSprites[i]);
                                break;
                }
 
-               SDL_SetColorKey(shipShape[i], SDL_TRUE,
-                       SDL_MapRGB(shipShape[i]->format, 0, 0, 0));
-       }
-
-       strcpy(string, "data/resources_all.dat");
-
-       fp = fopen(string, "rb");
-
-       while (fscanf(fp, "%d %s", &index, string) == 2)
-       {
-               shape[index] = loadImage(string);
+               SDL_SetColorKey(gfx_shipSprites[i], SDL_TRUE,
+                       SDL_MapRGB(gfx_shipSprites[i]->format, 0, 0, 0));
        }
 
-       fclose(fp);
+       // Other sprites
+       gfx_sprites[SP_PLASMA_GREEN] = gfx_loadImage("gfx/plasmaGreen.png");
+       gfx_sprites[SP_PLASMA_RED] = gfx_loadImage("gfx/plasmaRed.png");
+       gfx_sprites[SP_DIR_PLASMA_GREEN] = gfx_loadImage("gfx/greenDir.png");
+       gfx_sprites[SP_DIR_PLASMA_RED] = gfx_loadImage("gfx/redDir.png");
+       gfx_sprites[SP_ROCKET] = gfx_loadImage("gfx/rocket1.png");
+       gfx_sprites[SP_ROCKET_L] = gfx_loadImage("gfx/rocket2.png");
+       gfx_sprites[SP_SMALL_EXPLOSION] = gfx_loadImage("gfx/explode1.png");
+       gfx_sprites[SP_SMALL_EXPLOSION_2] = gfx_loadImage("gfx/explode2.png");
+       gfx_sprites[SP_SMALL_EXPLOSION_3] = gfx_loadImage("gfx/explode3.png");
+       gfx_sprites[SP_SMALL_EXPLOSION_L] = gfx_loadImage("gfx/explode4.png");
+       gfx_sprites[SP_BIG_EXPLOSION] = gfx_loadImage("gfx/explode05.png");
+       gfx_sprites[SP_BIG_EXPLOSION_2] = gfx_loadImage("gfx/explode06.png");
+       gfx_sprites[SP_BIG_EXPLOSION_3] = gfx_loadImage("gfx/explode07.png");
+       gfx_sprites[SP_BIG_EXPLOSION_L] = gfx_loadImage("gfx/explode08.png");
+       gfx_sprites[SP_SMOKE] = gfx_loadImage("gfx/explode9.png");
+       gfx_sprites[SP_SMOKE_2] = gfx_loadImage("gfx/explode10.png");
+       gfx_sprites[SP_SMOKE_3] = gfx_loadImage("gfx/explode11.png");
+       gfx_sprites[SP_SMOKE_L] = gfx_loadImage("gfx/explode12.png");
+       gfx_sprites[SP_TINY_EXPLOSION] = gfx_loadImage("gfx/explode13.png");
+       gfx_sprites[SP_TINY_EXPLOSION_2] = gfx_loadImage("gfx/explode14.png");
+       gfx_sprites[SP_TINY_EXPLOSION_3] = gfx_loadImage("gfx/explode15.png");
+       gfx_sprites[SP_TINY_EXPLOSION_L] = gfx_loadImage("gfx/explode16.png");
+       gfx_sprites[SP_ELECTRICAL] = gfx_loadImage("gfx/elec1.png");
+       gfx_sprites[SP_ELECTRICAL_2] = gfx_loadImage("gfx/elec2.png");
+       gfx_sprites[SP_ELECTRICAL_3] = gfx_loadImage("gfx/elec3.png");
+       gfx_sprites[SP_ELECTRICAL_L] = gfx_loadImage("gfx/elec4.png");
+       gfx_sprites[SP_PICKUP_MONEY] = gfx_loadImage("gfx/dollar.png");
+       gfx_sprites[SP_PICKUP_PLASMA] = gfx_loadImage("gfx/rocket.png");
+       gfx_sprites[SP_PICKUP_SHIELD] = gfx_loadImage("gfx/heart.png");
+       gfx_sprites[SP_PICKUP_PLASMA_OUTPUT] = gfx_loadImage("gfx/plasmaAmmo.png");
+       gfx_sprites[SP_PICKUP_PLASMA_RATE] = gfx_loadImage("gfx/plasmaRate.png");
+       gfx_sprites[SP_PICKUP_PLASMA_POWER] = gfx_loadImage("gfx/plasmaDamage.png");
+       gfx_sprites[SP_CHAIN_LINK] = gfx_loadImage("gfx/chainLink.png");
+       gfx_sprites[SP_MINE] = gfx_loadImage("gfx/mine.png");
+       gfx_sprites[SP_CARGO] = gfx_loadImage("gfx/cargo1.png");
+       gfx_sprites[SP_ION] = gfx_loadImage("gfx/stunBolt.png");
+       gfx_sprites[SP_ARROW_NORTH] = gfx_loadImage("gfx/arrowNorth.png");
+       gfx_sprites[SP_ARROW_NORTHEAST] = gfx_loadImage("gfx/arrowNorthEast.png");
+       gfx_sprites[SP_ARROW_EAST] = gfx_loadImage("gfx/arrowEast.png");
+       gfx_sprites[SP_ARROW_SOUTHEAST] = gfx_loadImage("gfx/arrowSouthEast.png");
+       gfx_sprites[SP_ARROW_SOUTH] = gfx_loadImage("gfx/arrowSouth.png");
+       gfx_sprites[SP_ARROW_SOUTHWEST] = gfx_loadImage("gfx/arrowSouthWest.png");
+       gfx_sprites[SP_ARROW_WEST] = gfx_loadImage("gfx/arrowWest.png");
+       gfx_sprites[SP_ARROW_NORTHWEST] = gfx_loadImage("gfx/arrowNorthWest.png");
+       gfx_sprites[SP_ARROW_FRIEND_NORTH] = gfx_loadImage("gfx/friendArrowNorth.png");
+       gfx_sprites[SP_ARROW_FRIEND_NORTHEAST] = gfx_loadImage("gfx/friendArrowNorthEast.png");
+       gfx_sprites[SP_ARROW_FRIEND_EAST] = gfx_loadImage("gfx/friendArrowEast.png");
+       gfx_sprites[SP_ARROW_FRIEND_SOUTHEAST] = gfx_loadImage("gfx/friendArrowSouthEast.png");
+       gfx_sprites[SP_ARROW_FRIEND_SOUTH] = gfx_loadImage("gfx/friendArrowSouth.png");
+       gfx_sprites[SP_ARROW_FRIEND_SOUTHWEST] = gfx_loadImage("gfx/friendArrowSouthWest.png");
+       gfx_sprites[SP_ARROW_FRIEND_WEST] = gfx_loadImage("gfx/friendArrowWest.png");
+       gfx_sprites[SP_ARROW_FRIEND_NORTHWEST] = gfx_loadImage("gfx/friendArrowNorthWest.png");
+       gfx_sprites[SP_INDICATOR_TARGET] = gfx_loadImage("gfx/targetText.png");
+       gfx_sprites[SP_INDICATOR_SID] = gfx_loadImage("gfx/sidText.png");
+       gfx_sprites[SP_INDICATOR_PHOEBE] = gfx_loadImage("gfx/phoebeText.png");
+       gfx_sprites[SP_INDICATOR_URSULA] = gfx_loadImage("gfx/ursulaText.png");
+       gfx_sprites[SP_INDICATOR_KLINE] = gfx_loadImage("gfx/klineText.png");
+       gfx_sprites[SP_ESCAPE_POD] = gfx_loadImage("gfx/pod.png");
+       gfx_sprites[SP_ORE] = gfx_loadImage("gfx/ore1.png");
+       gfx_sprites[SP_ORE_2] = gfx_loadImage("gfx/ore2.png");
+       gfx_sprites[SP_ORE_L] = gfx_loadImage("gfx/ore3.png");
+       gfx_sprites[SP_PICKUP_ROCKETS] = gfx_loadImage("gfx/rocketAmmo.png");
+       gfx_sprites[SP_SUPERCHARGE] = gfx_loadImage("gfx/superCharge.png");
 
        loadBackground(systemBackground[game.system]);
 
        for (int i = 0 ; i < CD_MAX ; i++)
        {
-               if (shipShape[alien_defs[i].imageIndex[0]] != NULL)
+               if (gfx_shipSprites[alien_defs[i].imageIndex[0]] != NULL)
                {
-                       alien_defs[i].image[0] = shipShape[alien_defs[i].imageIndex[0]];
-                       alien_defs[i].image[1] = shipShape[alien_defs[i].imageIndex[1]];
+                       alien_defs[i].image[0] = gfx_shipSprites[alien_defs[i].imageIndex[0]];
+                       alien_defs[i].image[1] = gfx_shipSprites[alien_defs[i].imageIndex[1]];
                        alien_defs[i].engineX = alien_defs[i].image[0]->w;
                        alien_defs[i].engineY = (alien_defs[i].image[0]->h / 2);
                }
        }
 
-       setWeaponShapes();
+       for (int i = 0 ; i < W_MAX ; i++)
+       {
+               weapon[i].image[0] = gfx_sprites[weapon[i].imageIndex[0]];
+               weapon[i].image[1] = gfx_sprites[weapon[i].imageIndex[1]];
+       }
 }
 
 
@@ -161,7 +268,7 @@ void loadFont()
 {
        SDL_Surface *image, *newImage;
 
-       for (int i = 0 ; i < MAX_FONTSHAPES ; i++)
+       for (int i = 0 ; i < FONT_MAX ; i++)
        {
                image = IMG_Load("gfx/smallFont.png");
 
@@ -172,26 +279,26 @@ void loadFont()
 
                switch(i)
                {
-                       case 1:
+                       case FONT_RED:
                                SDL_SetSurfaceColorMod(image, 255, 0, 0);
                                break;
-                       case 2:
+                       case FONT_YELLOW:
                                SDL_SetSurfaceColorMod(image, 255, 255, 0);
                                break;
-                       case 3:
+                       case FONT_GREEN:
                                SDL_SetSurfaceColorMod(image, 0, 255, 0);
                                break;
-                       case 4:
+                       case FONT_CYAN:
                                SDL_SetSurfaceColorMod(image, 0, 255, 255);
                                break;
-                       case 5:
+                       case FONT_OUTLINE:
                                SDL_SetSurfaceColorMod(image, 0, 0, 10);
                                break;
                }
 
                newImage = SDL_ConvertSurface(image, screen->format, 0);
 
-               fontShape[i] = setTransparent(newImage);
+               gfx_fontSprites[i] = gfx_setTransparent(newImage);
 
                SDL_FreeSurface(image);
        }
index f0e75c5..b89d832 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
diff --git a/src/screen.cpp b/src/screen.cpp
new file mode 100644 (file)
index 0000000..c0e44f2
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdlib.h>
+
+#include "SDL.h"
+
+#include "engine.h"
+#include "gfx.h"
+#include "structs.h"
+
+SDL_Surface *screen;
+bRect *screen_bufferHead;
+bRect *screen_bufferTail;
+
+void screen_blit(SDL_Surface *image, int x, int y)
+{
+       gfx_blit(image, x, y, screen);
+}
+
+void screen_blitText(int i)
+{
+       screen_blit(gfx_textSprites[i].image, (int)gfx_textSprites[i].x, (int)gfx_textSprites[i].y);
+}
+
+int screen_renderString(const char *in, int x, int y, int fontColor)
+{
+       return gfx_renderString(in, x, y, fontColor, 0, screen);
+}
+
+/*
+Draws the background surface that has been loaded
+*/
+void screen_drawBackground()
+{
+       screen_blit(gfx_background, 0, 0);
+}
+
+void screen_addBuffer(int x, int y, int w, int h)
+{
+       bRect *rect = new bRect;
+
+       rect->next = NULL;
+       rect->x = x;
+       rect->y = y;
+       rect->w = w;
+       rect->h = h;
+
+       screen_bufferTail->next = rect;
+       screen_bufferTail = rect;
+}
+
+void screen_flushBuffer()
+{
+       bRect *prevRect = screen_bufferHead;
+       bRect *rect = screen_bufferHead;
+       screen_bufferTail = screen_bufferHead;
+
+       while (rect->next != NULL)
+       {
+               rect = rect->next;
+
+               prevRect->next = rect->next;
+               delete rect;
+               rect = prevRect;
+       }
+
+       screen_bufferHead->next = NULL;
+}
+
+void screen_unBuffer()
+{
+       bRect *prevRect = screen_bufferHead;
+       bRect *rect = screen_bufferHead;
+       screen_bufferTail = screen_bufferHead;
+
+       while (rect->next != NULL)
+       {
+               rect = rect->next;
+
+               SDL_Rect blitRect;
+
+               blitRect.x = rect->x;
+               blitRect.y = rect->y;
+               blitRect.w = rect->w;
+               blitRect.h = rect->h;
+
+               if (SDL_BlitSurface(gfx_background, &blitRect, screen, &blitRect) < 0)
+               {
+                       printf("BlitSurface error: %s\n", SDL_GetError());
+                       engine_showError(2, "");
+               }
+
+               prevRect->next = rect->next;
+               delete rect;
+               rect = prevRect;
+       }
+
+       screen_bufferHead->next = NULL;
+}
+
+void screen_clear(Uint32 color)
+{
+       SDL_FillRect(screen, NULL, color);
+}
+
+void screen_drawRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue)
+{
+       gfx_drawRect(screen, x, y, w, h, red, green, blue);
+}
diff --git a/src/screen.h b/src/screen.h
new file mode 100644 (file)
index 0000000..42395a8
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SCREEN_H
+#define SCREEN_H
+
+#include "structs.h"
+
+extern SDL_Surface *screen;
+extern bRect *screen_bufferHead;
+extern bRect *screen_bufferTail;
+
+void screen_blit(SDL_Surface *image, int x, int y);
+void screen_blitText(int i);
+int screen_renderString(const char *in, int x, int y, int fontColor);
+void screen_drawBackground();
+void screen_addBuffer(int x, int y, int w, int h);
+void screen_flushBuffer();
+void screen_unBuffer();
+void screen_clear(Uint32 color);
+void screen_drawRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue);
+
+#endif
diff --git a/src/script.cpp b/src/script.cpp
deleted file mode 100644 (file)
index 8f49d2e..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
-Copyright (C) 2003 Parallel Realities
-Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 3
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "Starfighter.h"
-
-static cutMsg cutMessage[10];
-static event gameEvent[20];
-
-static void setKlineGreeting()
-{
-       static const char *greet[] = {
-               "¤Þ¤¿²ñ¤¨¤¿¤Ê¡¢¥Ð¥ó¥Õ¥£¡¼¥ë¥É!",
-               "È¿µÕ¼Ô¤è¡¢¤³¤ì¤Ç½ª¤ï¤ê¤À!",
-               "º£²ó¤Ï¼ºË¾¤µ¤»¤Ê¤¤¤Ç¤¯¤ì¡Ä",
-               "»ä¤òÅݤ»¤ë¤È»×¤Ã¤Æ¤¤¤ë¤Î¤«?!"
-       };
-
-       gameEvent[0].time = 2;
-       gameEvent[0].face = FACE_KLINE;
-       strcpy(gameEvent[0].message, greet[rand() % 4]);
-       gameEvent[0].entity = -1;
-       gameEvent[0].flag = 0;
-}
-
-void loadScriptEvents()
-{
-       for (int i = 0 ; i < 20 ; i++)
-       {
-               gameEvent[i].time = 0;
-               strcpy(gameEvent[i].message, "");
-               gameEvent[i].entity = -1;
-               gameEvent[i].flag = 0;
-       }
-       
-       if ((game.area == MISN_INTERCEPTION) &&
-                       (aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
-                       (aliens[ALIEN_KLINE].active))
-               setKlineGreeting();
-
-       char filename[255];
-       sprintf(filename, "data/script%d.txt", game.area);
-
-       FILE *fp;
-       int i = 0;
-
-       int time, entity, flags;
-       char face[255], message[255];
-
-       fp = fopen(filename, "rb");
-       if (fp == NULL)
-               return;
-
-       while (fscanf(fp, "%d %s %d %d ", &time, face, &entity, &flags) == 4)
-       {
-               if (fscanf(fp, "%[^\n]%*c", message) < 1)
-                       strcpy(message, "Error: Text missing");
-
-               gameEvent[i].time = time;
-               gameEvent[i].face = getFace(face);
-               gameEvent[i].entity = entity;
-               gameEvent[i].flag = flags;
-               strcpy(gameEvent[i].message, message);
-
-               i++;
-       }
-
-       fclose(fp);
-}
-
-void checkScriptEvents()
-{
-       for (int i = 0 ; i < 20 ; i++)
-       {
-               if (engine.timeTaken == gameEvent[i].time)
-               {
-                       if (strcmp(gameEvent[i].message, "@none@") != 0)
-                       {
-                               setRadioMessage(gameEvent[i].face, gameEvent[i].message, 1);
-                       }
-
-                       if (gameEvent[i].entity > -1)
-                       {
-                               if (gameEvent[i].flag != -FL_ACTIVATE)
-                               {
-                                       aliens[gameEvent[i].entity].flags += gameEvent[i].flag;
-                               }
-                               else
-                               {
-                                       aliens[gameEvent[i].entity].active = true;
-                                       aliens[gameEvent[i].entity].x = ((int)player.x +
-                                               RANDRANGE(400, 800));
-                                       aliens[gameEvent[i].entity].y = ((int)player.y +
-                                               RANDRANGE(-400, 800));
-                               }
-                       }
-
-                       gameEvent[i].time = 0;
-               }
-       }
-}
-
-void syncScriptEvents()
-{
-       for (int i = 0 ; i < 20 ; i++)
-       {
-               if (gameEvent[i].time < 0)
-               {
-                       gameEvent[i].time = engine.timeTaken + abs(gameEvent[i].time);
-               }
-       }
-}
-
-static void setScene(int scene)
-{
-       FILE *fp;
-       char string[255], face[255];
-       float sx, sy, x, y, speed;
-       int index, shape;
-
-       sprintf(string, "data/cutscene%d.dat", scene);
-
-       fp = fopen(string, "rb");
-
-       // Load in the specified background
-       if (fscanf(fp, "%s", string) < 1)
-       {
-               printf("Warning: didn't find a background definition for \"%s\"\n", string);
-               strcpy(string, "gfx/spirit.jpg");
-       }
-       loadBackground(string);
-
-       // Set the star speed
-       if (fscanf(fp, "%f %f", &sx, &sy) < 2)
-               printf("Warning: failed to read star speed data for cutscene");
-       engine.ssx = sx;
-       engine.ssy = sy;
-
-       // Read in the specs for each ship
-       while (fscanf(fp, "%d %d %f %f %f", &index, &shape, &x, &y, &speed) == 5)
-       {
-               if (x < 0) x = (rand() % abs((int)x));
-               if (y < 0) y = (rand() % abs((int)y));
-               if (speed <= -1) speed = 1 + (rand() % abs((int)speed));
-
-               if (shape > -1)
-               {
-                       aliens[index].image[0] = shipShape[shape];
-                       aliens[index].x = x;
-                       aliens[index].y = y;
-                       aliens[index].dx = speed;
-                       aliens[index].active = true;
-               }
-       }
-
-       // And finally read in the messages
-       index = 0;
-       while (fscanf(fp, "%s%*c %[^\n]", face, string) == 2)
-       {
-               if (strcmp(string, "@none@") == 0)
-                       break;
-
-               cutMessage[index].face = getFace(face);
-               strcpy(cutMessage[index].message, string);
-
-               index++;
-       }
-
-       fclose(fp);
-}
-
-void doCutscene(int scene)
-{
-       clearScreen(black);
-       updateScreen();
-       clearScreen(black);
-
-       engine.keyState[KEY_FIRE] = 0; 
-       engine.keyState[KEY_ALTFIRE] = 0;
-
-       engine.ssx = -0.5;
-       engine.ssy = 0;
-       engine.smx = 0;
-       engine.smy = 0;
-
-       flushBuffer();
-       freeGraphics();
-       resetLists();
-       loadGameGraphics();
-
-       for (int i = 0 ; i < 15 ; i++)
-       {
-               aliens[i] = alien_defs[0];
-               aliens[i].face = 0;
-               aliens[i].active = false;
-       }
-
-       for (int i = 0 ; i < 10 ; i++)
-       {
-               strcpy(cutMessage[i].message, "");
-               cutMessage[i].face = -1;
-       }
-
-       setScene(scene);
-
-       /*
-               Because we can fiddle with the images, we need to set the engines to 
-               the correct places on the craft. Otherwise it will look wrong
-       */
-       for (int i = 0 ; i < 15 ; i++)
-       {
-               aliens[i].engineX = aliens[i].image[0]->w;
-               aliens[i].engineY = (aliens[i].image[0]->h / 2);
-       }
-
-       bool showMessage = false;
-       signed char currentMessage = -1;
-       int timer = 60 * 4;
-
-       drawBackGround();
-
-       SDL_Surface *face;
-       
-       flushInput();
-
-       while (true)
-       {
-               updateScreen();
-               unBuffer();
-               getPlayerInput();
-               doStarfield();
-               game_doExplosions();
-
-               for (int i = 0 ; i < 15 ; i++)
-               {
-                       if (aliens[i].active)
-                       {
-                               explosion_addEngine(&aliens[i]);
-                               if (scene == 0 && i > 0 && (timer % 15) == i) {
-                                       aliens[i].dx += (drand48() - 0.5) * 0.1;
-                                       aliens[i].dy += (drand48() - 0.5) * 0.1;
-                                       if (aliens[i].x > 500 - timer)
-                                               aliens[i].dx -= 0.2;
-                                       if (aliens[i].x < 0)
-                                               aliens[i].dx += 0.2;
-                               }
-                               aliens[i].x += aliens[i].dx;
-                               aliens[i].y += aliens[i].dy;
-                               aliens[i].x += engine.ssx + engine.smx;
-                               blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
-                               if (aliens[i].x > (screen->w + 50))
-                               {
-                                       aliens[i].x = -50;
-                                       aliens[i].y = rand() % (screen->h - 40);
-                               }
-                               if (aliens[i].y < -50)
-                                       aliens[i].y = (screen->h + 50);
-                               if (aliens[i].y > (screen->h + 50))
-                                       aliens[i].y = -50;
-                       }
-               }
-
-               timer--;
-               if (timer == 0)
-               {
-                       showMessage = !showMessage;
-                       timer = 120;
-                       if (showMessage)
-                       {
-                               timer = 60 * 7;
-                               currentMessage++;
-
-                               if (currentMessage == 10)
-                                       break;
-
-                               if (strcmp(cutMessage[currentMessage].message, "") == 0)
-                                       break;
-
-                               face = NULL;
-                               if (cutMessage[currentMessage].face != -1)
-                                       face = shape[cutMessage[currentMessage].face];
-                               createMessageBox(face, cutMessage[currentMessage].message, 0);
-                       }
-               }
-
-               if ((showMessage) && (messageBox != NULL))
-                       blit(messageBox, (screen->w - messageBox->w) / 2, screen->h - 100);
-
-               drawString("²¿¤«¥­¡¼¤ò²¡¤¹¤È¥¹¥­¥Ã¥×¤¹¤ë", -1, 580, FONT_WHITE);
-
-               delayFrame();
-
-               if ((engine.keyState[KEY_ESCAPE]) || (engine.keyState[KEY_FIRE]) ||
-                               (engine.keyState[KEY_ALTFIRE]))
-                       break;
-       }
-
-       flushBuffer();
-       freeGraphics();
-       clearScreen(black);
-       updateScreen();
-}
index 502ce42..1d9bb1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -19,6 +19,27 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
+bool ship_collision(object *ship, object *otherShip)
+{
+       float x0 = ship->x;
+       float y0 = ship->y;
+       float w0 = ship->image[0]->w;
+       float h0 = ship->image[0]->h;
+
+       float x2 = otherShip->x;
+       float y2 = otherShip->y;
+       float w1 = otherShip->image[0]->w;
+       float h1 = otherShip->image[0]->h;
+
+       float x1 = x0 + w0;
+       float y1 = y0 + h0;
+
+       float x3 = x2 + w1;
+       float y3 = y2 + h1;
+
+       return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);
+}
+
 /*
 Fill in later...
 */
@@ -40,16 +61,16 @@ void ship_fireBullet(object *ship, int weaponType)
                case WT_PLASMA:
                case WT_SPREAD:
                case WT_DIRECTIONAL:
-                       audio_playSound(SFX_PLASMA, ship->x);
+                       audio_playSound(SFX_PLASMA, ship->x, ship->y);
                        break;
                case WT_ROCKET:
-                       audio_playSound(SFX_MISSILE, ship->x);
+                       audio_playSound(SFX_MISSILE, ship->x, ship->y);
                        break;
                case WT_LASER:
-                       audio_playSound(SFX_LASER, ship->x);
+                       audio_playSound(SFX_LASER, ship->x, ship->y);
                        break;
                case WT_CHARGER:
-                       audio_playSound(SFX_PLASMA3, ship->x);
+                       audio_playSound(SFX_PLASMA3, ship->x, ship->y);
                        break;
        }
 
@@ -74,16 +95,16 @@ void ship_fireBullet(object *ship, int weaponType)
        }
        else
        {
-               if(theWeapon->ammo[0] & 1)
+               if (theWeapon->ammo[0] & 1)
                        bullet_add(theWeapon, ship, y * 3, 0);
 
-               if(theWeapon->ammo[0] >= 2)
+               if (theWeapon->ammo[0] >= 2)
                {
                        bullet_add(theWeapon, ship, y * 2, 0);
                        bullet_add(theWeapon, ship, y * 4, 0);
                }
 
-               if(theWeapon->ammo[0] >= 4)
+               if (theWeapon->ammo[0] >= 4)
                {
                        bullet_add(theWeapon, ship, y * 1, 0);
                        bullet_add(theWeapon, ship, y * 5, 0);
@@ -136,31 +157,31 @@ void ship_fireRay(object *ship)
 
        int red = SDL_MapRGB(screen->format, rand() % 256, 0x00, 0x00);
        SDL_FillRect(screen, &ray, red);
-       addBuffer(ray.x, ray.y, ray.w, ray.h);
+       screen_addBuffer(ray.x, ray.y, ray.w, ray.h);
 
        if (ship != &player)
        {
                if (player.shield > 0)
                {
-                       if (collision(player.x, player.y, player.image[0]->w,
-                                       player.image[0]->h, ray.x, ray.y, ray.w, ray.h) &&
-                               (!engine.cheatShield))
+                       if (game_collision(player.x, player.y, player.image[0]->w,
+                                               player.image[0]->h, ray.x, ray.y, ray.w, ray.h) &&
+                                       (!engine.cheatShield) && (engine.missionCompleteTimer == 0))
                        {
                                if (player.shield > engine.lowShield)
                                {
                                        if (player.shield - 1 <= engine.lowShield)
                                        {
-                                               setInfoLine("!!! ·Ù¹ð: ¥·¡¼¥ë¥ÉÄã²¼ !!!", FONT_RED);
+                                               setInfoLine("!!! \8cx\8d\90\83V\81[\83\8b\83h\92á\89º !!!", FONT_RED);
                                        }
                                }
                                player.shield--;
 
-                               explosion_add(player.x, player.y, E_SMALL_EXPLOSION);
-                               audio_playSound(SFX_HIT, player.x);
+                               explosion_add(player.x, player.y, SP_SMALL_EXPLOSION);
+                               audio_playSound(SFX_HIT, player.x, player.y);
                                if (player.shield < 1)
                                {
-                                       audio_playSound(SFX_DEATH, player.x);
-                                       audio_playSound(SFX_EXPLOSION, player.x);
+                                       audio_playSound(SFX_DEATH, player.x, player.y);
+                                       audio_playSound(SFX_EXPLOSION, player.x, player.y);
                                }
                        }
                }
@@ -174,7 +195,7 @@ void ship_fireRay(object *ship)
                if ((aliens[i].shield > 0) && (ship != &aliens[i]) &&
                        (ship->classDef != aliens[i].classDef))
                {
-                       if (collision(aliens[i].x, aliens[i].y, aliens[i].image[0]->w,
+                       if (game_collision(aliens[i].x, aliens[i].y, aliens[i].image[0]->w,
                                        aliens[i].image[0]->h, ray.x, ray.y, ray.w, ray.h))
                        {
                                alien_hurt(&aliens[i], ship->owner, 1, false);
index 63b1025..8109d06 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -18,6 +18,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef SHIP_H
 #define SHIP_H
 
+bool ship_collision(object *ship, object *otherShip);
 void ship_fireBullet(object *ship, int weaponType);
 void ship_fireRay(object *ship);
 
index 1f96ae4..625b3af 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -19,8 +19,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
-static ShopItem shopItems[MAX_SHOPITEMS];
-static signed char shopSelectedItem;
+static ShopItem shopItems[SHOP_MAX];
+static int shopSelectedItem;
 
 static void sell(int i);
 
@@ -28,7 +28,7 @@ static void drawSecondaryWeaponSurface()
 {
        char description[50] = "";
 
-       drawString("ÉûÁõÈ÷", 10, 3, FONT_WHITE, shopSurface[2]);
+       gfx_renderString("ÉûÁõÈ÷", 10, 3, FONT_WHITE, 0, gfx_shopSprites[2]);
 
        switch (player.weaponType[1])
        {
@@ -60,13 +60,13 @@ static void drawSecondaryWeaponSurface()
                        strcpy(description, "¥¿¥¤¥×¡§¥Þ¥¤¥¯¥í ¥Û¡¼¥ß¥ó¥° ¥ß¥µ¥¤¥ë");
                        break;
        }
-       drawString(description, 10, 22, FONT_WHITE, shopSurface[2]);
+       gfx_renderString(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[2]);
 
        if ((player.weaponType[1] != W_LASER) &&
                (player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
        {
                sprintf(description, "ºÇÂç¿ô¡§%d", game.maxRocketAmmo);
-               drawString(description, 10, 37, FONT_WHITE, shopSurface[2]);
+               gfx_renderString(description, 10, 37, FONT_WHITE, 0, gfx_shopSprites[2]);
        }
 }
 
@@ -74,35 +74,23 @@ static void adjustShopPrices()
 {
        if (game.difficulty == DIFFICULTY_ORIGINAL)
        {
-               shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (500 *
-                       game.maxPlasmaOutput);
-               shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (500 *
-                       game.maxPlasmaDamage);
-               shopItems[SHOP_PLASMA_MAX_RATE].price = (500 *
-                       (game.maxPlasmaRate * 2 - 1));
-
-               shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (2000 *
-                       game.minPlasmaOutput);
-               shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (2000 *
-                       game.minPlasmaDamage);
-               shopItems[SHOP_PLASMA_MIN_RATE].price = (2000 *
-                       (game.minPlasmaRate * 2 - 1));
+               shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 500 * game.maxPlasmaOutput;
+               shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 500 * game.maxPlasmaDamage;
+               shopItems[SHOP_PLASMA_MAX_RATE].price = 500 * (game.maxPlasmaRate * 2 - 1);
+
+               shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 2000 * game.minPlasmaOutput;
+               shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 2000 * game.minPlasmaDamage;
+               shopItems[SHOP_PLASMA_MIN_RATE].price = 2000 * (game.minPlasmaRate * 2 - 1);
        }
        else
        {
-               shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (1000 *
-                       (game.maxPlasmaOutput + 1));
-               shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (1000 *
-                       (game.maxPlasmaDamage + 1));
-               shopItems[SHOP_PLASMA_MAX_RATE].price = (1000 *
-                       (game.maxPlasmaRate + 1));
-
-               shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (1500 *
-                       (game.minPlasmaOutput + 1));
-               shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (1500 *
-                       (game.minPlasmaDamage + 1));
-               shopItems[SHOP_PLASMA_MIN_RATE].price = (1500 *
-                       (game.minPlasmaRate + 1));
+               shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 1000 * (game.maxPlasmaOutput + 1);
+               shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 1000 * (game.maxPlasmaDamage + 1);
+               shopItems[SHOP_PLASMA_MAX_RATE].price = 1000 * (game.maxPlasmaRate + 1);
+
+               shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 1500 * (game.minPlasmaOutput + 1);
+               shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 1500 * (game.minPlasmaDamage + 1);
+               shopItems[SHOP_PLASMA_MIN_RATE].price = 1500 * (game.minPlasmaRate + 1);
        }
 
        if (game.maxPlasmaOutput <= game.minPlasmaOutput)
@@ -142,27 +130,32 @@ static void adjustShopPrices()
 
 static void drawShop()
 {
+       char description[100];
+       int icons = SHOP_MAX;
+
        adjustShopPrices();
 
-       for (int i = 0 ; i < MAX_SHOPSHAPES ; i++)
+       for (int i = 0 ; i < SHOP_S_MAX ; i++)
        {
-               if (shopSurface[i] != NULL)
+               if (gfx_shopSprites[i] != NULL)
                {
-                       SDL_FreeSurface(shopSurface[i]);
+                       SDL_FreeSurface(gfx_shopSprites[i]);
                }
        }
 
-       for (int i = 0 ; i < 3 ; i++)
-               shopSurface[i] = createSurface(246, 91);
+       gfx_shopSprites[SHOP_S_PRIMARY] = gfx_createSurface(246, 91);
+       gfx_shopSprites[SHOP_S_POWERUP] = gfx_createSurface(246, 91);
+       gfx_shopSprites[SHOP_S_SECONDARY] = gfx_createSurface(246, 91);
 
-       for (int i = 0 ; i < 3 ; i++)
-       {
-               blevelRect(shopSurface[i], 0, 0, 245, 90, 0x00, 0x00, 0x55);
-               blevelRect(shopSurface[i], 0, 0, 245, 20, 0x00, 0x00, 0x99);
-       }
+       gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 245, 90, 0x00, 0x00, 0x55);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 245, 20, 0x00, 0x00, 0x99);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 245, 90, 0x00, 0x00, 0x55);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 245, 20, 0x00, 0x00, 0x99);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 245, 90, 0x00, 0x00, 0x55);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 245, 20, 0x00, 0x00, 0x99);
 
-       shopSurface[4] = alphaRect(601, 101, 0x00, 0x00, 0x00);
-       blevelRect(shopSurface[4], 0, 0, 600, 100, 0x00, 0x00, 0x33);
+       gfx_shopSprites[SHOP_S_SHIP_INFO] = gfx_createAlphaRect(601, 101, 0x00, 0x00, 0x00);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, 600, 100, 0x00, 0x00, 0x33);
 
        switch (shopSelectedItem)
        {
@@ -173,69 +166,66 @@ static void drawShop()
                case -5:
                case -6:
                        break;
-               case 0:
-               case 1:
-               case 2:
-               case 8:
-                       blevelRect(shopSurface[1], 0, 0, 245, 90, 0x55, 0x00, 0x00);
-                       blevelRect(shopSurface[1], 0, 0, 245, 20, 0x99, 0x00, 0x00);
+               case SHOP_PLASMA_MAX_OUTPUT:
+               case SHOP_PLASMA_MAX_DAMAGE:
+               case SHOP_PLASMA_MAX_RATE:
+               case SHOP_PLASMA_MAX_AMMO:
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 245, 90, 0x55, 0x00, 0x00);
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_POWERUP], 0, 0, 245, 20, 0x99, 0x00, 0x00);
                        break;
-               case 3:
-               case 4:
-                       blevelRect(shopSurface[4], 0, 0, 600, 100, 0x33, 0x00, 0x00);
+               case SHOP_PLASMA_MIN_OUTPUT:
+               case SHOP_PLASMA_MIN_DAMAGE:
+               case SHOP_PLASMA_MIN_RATE:
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 245, 90, 0x55, 0x00, 0x00);
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_PRIMARY], 0, 0, 245, 20, 0x99, 0x00, 0x00);
                        break;
-               case 5:
-               case 6:
-               case 7:
-                       blevelRect(shopSurface[0], 0, 0, 245, 90, 0x55, 0x00, 0x00);
-                       blevelRect(shopSurface[0], 0, 0, 245, 20, 0x99, 0x00, 0x00);
+               case SHOP_PLASMA_AMMO:
+               case SHOP_ROCKET_AMMO:
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_SHIP_INFO], 0, 0, 600, 100, 0x33, 0x00, 0x00);
                        break;
                default:
-                       blevelRect(shopSurface[2], 0, 0, 245, 90, 0x55, 0x00, 0x00);
-                       blevelRect(shopSurface[2], 0, 0, 245, 20, 0x99, 0x00, 0x00);
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 245, 90, 0x55, 0x00, 0x00);
+                       gfx_drawRect(gfx_shopSprites[SHOP_S_SECONDARY], 0, 0, 245, 20, 0x99, 0x00, 0x00);
                        break;
        }
 
-       char description[100];
        strcpy(description, "");
 
-       drawString("¼çÁõÈ÷", 10, 3, FONT_WHITE, shopSurface[0]);
+       gfx_renderString("¼çÁõÈ÷", 10, 3, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_PRIMARY]);
        sprintf(description, "¥×¥é¥º¥Þ¥«¥Î¥ó¡§%dÌç", game.minPlasmaOutput);
-       drawString(description, 10, 22, FONT_WHITE, shopSurface[0]);
+       gfx_renderString(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_PRIMARY]);
        sprintf(description, "¥×¥é¥º¥Þ²ÐÎÏ¡¡¡§¥ì¥Ù¥ë %d",
                game.minPlasmaDamage);
-       drawString(description, 10, 37, FONT_WHITE, shopSurface[0]);
+       gfx_renderString(description, 10, 37, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_PRIMARY]);
        sprintf(description, "ÎäµÑÁõÃÖ¡¡¡¡¡¡¡§¥ì¥Ù¥ë %d",
                game.minPlasmaRate);
-       drawString(description, 10, 52, FONT_WHITE, shopSurface[0]);
+       gfx_renderString(description, 10, 52, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_PRIMARY]);
 
-       drawString("°ì»þ¶¯²½", 10, 3, FONT_WHITE, shopSurface[1]);
+       gfx_renderString("°ì»þ¶¯²½", 10, 3, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_POWERUP]);
        sprintf(description, "¥×¥é¥º¥Þ½ÐÎÏÈÏ°Ï¡¡¡§¥ì¥Ù¥ë %d",
                game.maxPlasmaOutput);
-       drawString(description, 10, 22, FONT_WHITE, shopSurface[1]);
+       gfx_renderString(description, 10, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_POWERUP]);
        sprintf(description, "¥×¥é¥º¥Þ¥³¥ó¥Ç¥ó¥µ¡§¥ì¥Ù¥ë %d",
                game.maxPlasmaDamage);
-       drawString(description, 10, 37, FONT_WHITE, shopSurface[1]);
+       gfx_renderString(description, 10, 37, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_POWERUP]);
        sprintf(description, "±ÕÂÎÃâÁÇ¡¡¡¡¡¡¡¡¡¡¡§¥ì¥Ù¥ë %d",
                game.maxPlasmaRate);
-       drawString(description, 10, 52, FONT_WHITE, shopSurface[1]);
+       gfx_renderString(description, 10, 52, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_POWERUP]);
        sprintf(description, "¥×¥é¥º¥ÞÍÆÎÌ¡¡¡¡¡¡¡§%d", game.maxPlasmaAmmo);
-       drawString(description, 10, 67, FONT_WHITE, shopSurface[1]);
+       gfx_renderString(description, 10, 67, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_POWERUP]);
 
        drawSecondaryWeaponSurface();
 
-       shopSurface[3] = createSurface(601, 121);
-
-       blevelRect(shopSurface[3], 0, 0, 600, 120, 0x00, 0x00, 0x22);
+       gfx_shopSprites[SHOP_S_CATALOG] = gfx_createSurface(601, 121);
 
-       drawString("°ì»þ¶¯²½", 10, 2, FONT_WHITE, shopSurface[3]);
-       drawString("ÇúÌô¤È¥³¥ó¥Æ¥Ê", 260, 2, FONT_WHITE, shopSurface[3]);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_CATALOG], 0, 0, 600, 120, 0x00, 0x00, 0x22);
 
-       drawString("¼çÁõÈ÷", 10, 62, FONT_WHITE, shopSurface[3]);
+       gfx_renderString("°ì»þ¶¯²½", 10, 2, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_CATALOG]);
+       gfx_renderString("ÇúÌô¤È¥³¥ó¥Æ¥Ê", 260, 2, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_CATALOG]);
 
-       drawString("ÉûÁõÈ÷", 260, 62, FONT_WHITE, shopSurface[3]);
+       gfx_renderString("¼çÁõÈ÷", 10, 62, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_CATALOG]);
 
-       signed char icons = MAX_SHOPITEMS;
+       gfx_renderString("ÉûÁõÈ÷", 260, 62, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_CATALOG]);
 
        if (game.system == 0)
                icons = SHOP_DOUBLE_ROCKETS + 1;
@@ -246,59 +236,61 @@ static void drawShop()
 
        for (int i = 0 ; i < icons ; i++)
        {
-               blit(shape[shopItems[i].image], shopItems[i].x - 90,
-                       shopItems[i].y - 178, shopSurface[3]);
+               gfx_blit(gfx_sprites[shopItems[i].image], shopItems[i].x - 90,
+                       shopItems[i].y - 178, gfx_shopSprites[SHOP_S_CATALOG]);
        }
 
        sprintf(description, "\8e¼\8e°\8eÙ\8eÄ\8eÞ \8eÕ\8eÆ\8e¯\8eÄ : %d", player.maxShield);
-       drawString(description, 10, 4, FONT_WHITE, shopSurface[4]);
+       gfx_renderString(description, 10, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
        sprintf(description, "\8e·\8e¬\8e¯\8e¼\8e­ : $%d", game.cash);
-       drawString(description, 10, 80, FONT_WHITE, shopSurface[4]);
+       gfx_renderString(description, 10, 80, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
        sprintf(description, "\8eÌ\8eß\8e×\8e½\8eÞ\8eÏ \8e¾\8eÙ : %.3d", player.ammo[0]);
-       drawString(description, 430, 4, FONT_WHITE, shopSurface[4]);
+       gfx_renderString(description, 430, 4, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
        sprintf(description, "\8eÛ\8e¹\8e¯\8eÄ : %.3d", player.ammo[1]);
-       drawString(description, 475, 80, FONT_WHITE, shopSurface[4]);
+       gfx_renderString(description, 475, 80, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
 
-       shopSurface[5] = createSurface(601, 56);
-       blevelRect(shopSurface[5], 0, 0, 600, 35, 0x00, 0x99, 0x00);
-       blevelRect(shopSurface[5], 0, 20, 600, 35, 0x00, 0x33, 0x00);
-       drawString("ÀâÌÀ", 5, 4, FONT_WHITE, shopSurface[5]);
+       gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(601, 56);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 0, 600, 35, 0x00, 0x99, 0x00);
+       gfx_drawRect(gfx_shopSprites[SHOP_S_ITEM_INFO], 0, 20, 600, 35, 0x00, 0x33, 0x00);
+       gfx_renderString("ÀâÌÀ", 5, 4, FONT_WHITE, 0, gfx_shopSprites[5]);
 
        switch (shopSelectedItem)
        {
                case -1:
                        break;
                case -2:
-                       drawString("Âå¶â¤¬Â­¤ê¤Ê¤¤", 20, 30, FONT_WHITE,
-                               shopSurface[5]);
+                       gfx_renderString("Âå¶â¤¬Â­¤ê¤Ê¤¤", 20, 30, FONT_WHITE,
+                               0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -3:
-                       drawString("¶¯²½¤Ç¤­¤Ê¤¤", 5, 22, FONT_WHITE, shopSurface[5]);
-                       drawString("µ¡ÂΤ賦¤Ë㤷¤Æ¤¤¤ë", 20, 38, FONT_CYAN,
-                               shopSurface[5]);
+                       gfx_renderString("¶¯²½¤Ç¤­¤Ê¤¤", 5, 22, FONT_WHITE, 0,
+                               gfx_shopSprites[SHOP_S_ITEM_INFO]);
+                       gfx_renderString("µ¡ÂΤ賦¤Ë㤷¤Æ¤¤¤ë", 20, 38,
+                               FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -4:
-                       drawString("ÍÆÎ̤賦¤Ë㤷¤Æ¤¤¤ë", 20, 30, FONT_WHITE,
-                               shopSurface[5]);
+                       gfx_renderString("ÍÆÎ̤賦¤Ë㤷¤Æ¤¤¤ë", 20, 30, FONT_WHITE, 0,
+                               gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -5:
-                       drawString("¤½¤ì¤ÏÇäµÑ¤Ç¤­¤Ê¤¤", 20, 30, FONT_WHITE,
-                               shopSurface[5]);
+                       gfx_renderString("¤½¤ì¤ÏÇäµÑ¤Ç¤­¤Ê¤¤", 20, 30, FONT_WHITE,
+                               0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -6:
-                       drawString("ÇäµÑ¤Ç¤­¤ë¤â¤Î¤¬¤Ê¤¤", 20, 30, FONT_WHITE, shopSurface[5]);
+                       gfx_renderString("ÇäµÑ¤Ç¤­¤ë¤â¤Î¤¬¤Ê¤¤", 20, 30, FONT_WHITE, 0,
+                               gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -7:
-                       drawString("¥ì¡¼¥¶¡¼¤Þ¤¿¤Ï¥Á¥ã¡¼¥¸¤Î¾ì¹ç¤Ï¥í¥±¥Ã¥ÈÃƤò¹ØÆþ¤Ç¤­¤Ê¤¤",
-                               5, 30, FONT_WHITE, shopSurface[5]);
+                       gfx_renderString("¥ì¡¼¥¶¡¼¤Þ¤¿¤Ï¥Á¥ã¡¼¥¸¤Î¾ì¹ç¤Ï¥í¥±¥Ã¥ÈÃƤò¹ØÆþ¤Ç¤­¤Ê¤¤",
+                               5, 30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -8:
-                       drawString("´û¤ËÁõÈ÷¤·¤Æ¤¤¤ë", 20, 30, FONT_WHITE,
-                               shopSurface[5]);
+                       gfx_renderString("´û¤ËÁõÈ÷¤·¤Æ¤¤¤ë", 20, 30,
+                               FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                case -9:
-                       drawString("¤½¤ÎÁõÈ÷¤Î¸Â³¦¤Ë㤷¤Æ¤¤¤ë", 20, 30,
-                               FONT_WHITE, shopSurface[5]);
+                       gfx_renderString("¤½¤ÎÁõÈ÷¤Î¸Â³¦¤Ë㤷¤Æ¤¤¤ë", 20,
+                               30, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
                default:
                        if (shopItems[shopSelectedItem].price != 0)
@@ -312,9 +304,9 @@ static void drawShop()
                                sprintf(description, "%s (N/A)",
                                        shopItems[shopSelectedItem].description);
                        }
-                       drawString(shopItems[shopSelectedItem].name, 5, 22, FONT_WHITE,
-                               shopSurface[5]);
-                       drawString(description, 20, 38, FONT_CYAN, shopSurface[5]);
+                       gfx_renderString(shopItems[shopSelectedItem].name, 5, 22,
+                               FONT_WHITE, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
+                       gfx_renderString(description, 20, 38, FONT_CYAN, 0, gfx_shopSprites[SHOP_S_ITEM_INFO]);
                        break;
        }
 }
@@ -341,12 +333,20 @@ void initShop()
                "°ì»þ¶¯²½»þ¤ÎÏ¢¼Í®ÅÙ¤¬Áý²Ã¤¹¤ë");
        shopItems[SHOP_PLASMA_MAX_RATE].image = 11;
 
-       shopItems[SHOP_PLASMA_AMMO].price = 10;
+       if (game.difficulty == DIFFICULTY_ORIGINAL)
+               shopItems[SHOP_PLASMA_AMMO].price = 50;
+       else
+               shopItems[SHOP_PLASMA_AMMO].price = 1;
+
        strcpy(shopItems[SHOP_PLASMA_AMMO].name, "10 ¥×¥é¥º¥Þ¥»¥ë");
        strcpy(shopItems[SHOP_PLASMA_AMMO].description, "¥×¥é¥º¥Þ²ÐÌô");
        shopItems[SHOP_PLASMA_AMMO].image = 12;
 
-       shopItems[SHOP_ROCKET_AMMO].price = 10;
+       if (game.difficulty == DIFFICULTY_ORIGINAL)
+               shopItems[SHOP_ROCKET_AMMO].price = 50;
+       else
+               shopItems[SHOP_ROCKET_AMMO].price = 1;
+
        strcpy(shopItems[SHOP_ROCKET_AMMO].name, "¥í¥±¥Ã¥ÈÃÆ");
        strcpy(shopItems[SHOP_ROCKET_AMMO].description,
                "̵ͶƳ¹â®¥í¥±¥Ã¥ÈÃÆ");
@@ -483,10 +483,6 @@ void initShop()
 
        shopSelectedItem = -1;
 
-       player.image[0] = shape[0];
-       player.x = 380;
-       player.y = 95;
-
        drawShop();
 }
 
@@ -1016,22 +1012,22 @@ static void sell(int i)
 
 void showShop()
 {
-       blit(shopSurface[0], 20, 395);
-       blit(shopSurface[1], 275, 395);
-       blit(shopSurface[2], 530, 395);
-       blit(shopSurface[3], 100, 180);
-       blit(shopSurface[4], 100, 50);
-       blit(shopSurface[5], 100, 320);
+       int icons = SHOP_MAX;
+
+       screen_blit(gfx_shopSprites[SHOP_S_PRIMARY], 20, 395);
+       screen_blit(gfx_shopSprites[SHOP_S_POWERUP], 275, 395);
+       screen_blit(gfx_shopSprites[SHOP_S_SECONDARY], 530, 395);
+       screen_blit(gfx_shopSprites[SHOP_S_CATALOG], 100, 180);
+       screen_blit(gfx_shopSprites[SHOP_S_SHIP_INFO], 100, 50);
+       screen_blit(gfx_shopSprites[SHOP_S_ITEM_INFO], 100, 320);
 
        if (shopSelectedItem > -1)
        {
-               blit(shape[27], 60, 350);
-               blit(shape[28], 710, 350);
+               screen_blit(gfx_sprites[SP_BUY], 60, 350);
+               screen_blit(gfx_sprites[SP_SELL], 710, 350);
        }
 
-       blit(shape[29], (int)player.x, (int)player.y);
-
-       signed char icons = MAX_SHOPITEMS;
+       screen_blit(gfx_sprites[SP_FIREFLY], 380, 95);
 
        if (game.system == 0)
                icons = SHOP_DOUBLE_ROCKETS + 1;
@@ -1044,7 +1040,7 @@ void showShop()
        {
                for (int i = 0 ; i < icons ; i++)
                {
-                       if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
                                shopItems[i].x, shopItems[i].y, 32, 25))
                        {
                                shopSelectedItem = i;
@@ -1055,14 +1051,14 @@ void showShop()
 
                if (shopSelectedItem > -1)
                {
-                       if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 60, 350, 24, 16))
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 60, 350, 24, 16))
                        {
                                buy(shopSelectedItem);
                                engine.keyState[KEY_FIRE] = 0;
                                drawShop();
                        }
 
-                       if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 700, 350, 24, 16))
+                       if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 700, 350, 24, 16))
                        {
                                sell(shopSelectedItem);
                                engine.keyState[KEY_FIRE] = 0;
index ba93fe9..983657f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index 58ca24c..f860a58 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -20,14 +20,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef STRUCTS_H
 #define STRUCTS_H
 
-struct object {
+typedef struct object_ {
 
        bool active;
        int classDef; // Used by aliens to determine what they are
        int AIType; // Type of articifial intelligence
 
        int id; // The "job" of the object
-       object *target; //  index target in aliens array
+       struct object_ *target; //  index target in aliens array
 
        int reload[2];
 
@@ -42,7 +42,7 @@ struct object {
 
        int face; // Either 0 or 1
 
-       object *owner; // Who owns this object
+       struct object_ *owner; // Who owns this object
 
        int chance[2]; // Chance of using the weapons (out of 1000)
 
@@ -64,11 +64,11 @@ struct object {
 
        float x, y, dx, dy;
 
-       object *next;
+       struct object_ *next;
 
-};
+} object;
 
-struct mission {
+typedef struct mission_ {
 
        char primaryObjective[3][50]; // Description
        int primaryType[3]; // The type of mission this is
@@ -88,16 +88,16 @@ struct mission {
        int remainingObjectives2;
        int addAliens; // How often to add new enemies
 
-};
+} mission;
 
-struct Star {
+typedef struct Star_ {
 
        float x, y, dx, dy;
        int speed; // How fast the star moves
 
-};
+} Star;
 
-struct collectables {
+typedef struct collectables_ {
 
        bool active;
        float x, y, dx, dy;
@@ -106,11 +106,11 @@ struct collectables {
        int value; // How much is it worth?
        int life; // How long it will stay around for
 
-       collectables *next;
+       struct collectables_ *next;
 
-};
+} collectables;
 
-struct textObject {
+typedef struct textObject_ {
 
        SDL_Surface *image;
        int life;
@@ -118,9 +118,9 @@ struct textObject {
        int fontColor;
        char text[255];
 
-};
+} textObject;
 
-struct Game {
+typedef struct Game_ {
        object thePlayer;
        object playerWeapon;
 
@@ -162,7 +162,7 @@ struct Game {
        // remaining shield for experimental fighter
        int experimentalShield;
 
-       long int timeTaken; // In seconds
+       Uint32 timeTaken; // In seconds
        int missionCompleted[10];
 
        int stationedPlanet;
@@ -191,25 +191,26 @@ struct Game {
        int maxPlasmaAmmoLimit;
        int maxRocketAmmoLimit;
 
-};
+} Game;
 
-struct ShopItem {
+typedef struct ShopItem_ {
 
        int x, y;
        int price;
        char name[50];
        char description[255];
        int image;
-};
 
-struct bRect {
+} ShopItem;
+
+typedef struct bRect_ {
 
        int x, y, w, h;
-       bRect *next;
+       struct bRect_ *next;
 
-};
+} bRect;
 
-struct Planet {
+typedef struct Planet_ {
 
        int y;
        char name[50];
@@ -223,112 +224,7 @@ struct Planet {
        int faceImage;
        char from[50];
        char subject[100];
-};
-
-enum keys {
-       KEY_UP,
-       KEY_DOWN,
-       KEY_LEFT,
-       KEY_RIGHT,
-       KEY_FIRE,
-       KEY_ALTFIRE,
-       KEY_SWITCH,
-       KEY_PAUSE,
-       KEY_ESCAPE,
-       KEY_FULLSCREEN,
-       KEY_DUMMY,
-       KEY_LAST
-};
-
-struct Engine {
-
-       SDL_Event event;
-       int done;
-
-       SDL_RWops *sdlrw;
-
-       float musicVolume;
-
-       int maxAliens;
-
-       float ssx;
-       float ssy;
-       float smx;
-       float smy;
-
-       object *bulletHead;
-       object *bulletTail;
-       object *explosionHead;
-       object *explosionTail;
-       collectables *collectableHead;
-       collectables *collectableTail;
-       object *debrisHead;
-       object *debrisTail;
-
-       int cursor_x, cursor_y;
-
-       int commsSection;
-
-       int eventTimer;
-
-       int lowShield;
-       int averageShield;
-
-       float targetShield;
-       int targetIndex;
-
-       // Mission completion timer (allows for 4 seconds before leaving sector)
-       long missionCompleteTimer;
-
-       // Times the mission normally
-       Uint32 counter2;
-       long int timeTaken; // In seconds
-
-       // For missions with a time limit
-       int timeMission;
-       Uint32 counter;
-       int seconds;
-       int minutes;
-
-       // Mission Related stuff
-       int allAliensDead;
-       int addAliens;
-
-       bool paused;
-       int gameSection;
-
-       bool useAudio;
-       bool useSound;
-       bool useMusic;
-       bool fullScreen;
-       bool autoPause;
-
-       char userHomeDirectory[1024];
-       
-       char keyState[KEY_LAST];
-
-       bool cheat; // overall cheat
-       bool cheatShield;
-       bool cheatCash;
-       bool cheatAmmo;
-       bool cheatTime;
-       bool cheatCredits;
-};
-
-struct event {
-
-       int time;
-       char message[255];
-       int face;
-       int entity;
-       int flag;
-};
-
-struct cutMsg {
-
-       int face;
-       char message[255];
 
-};
+} Planet;
 
 #endif
index e6850ba..36f716b 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2012, 2013 Guus Sliepen
-Copyright (C) 2012, 2015 Julian Marchant
+Copyright (C) 2012, 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -19,25 +19,25 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
-static signed char showGameMenu(signed char continueSaveSlot)
+static int showGameMenu(int continueSaveSlot)
 {
-       blitText(TS_START_NEW_GAME);
+       screen_blitText(TS_START_NEW_GAME);
+       screen_blitText(TS_LOAD_GAME);
        if (continueSaveSlot != -1)
        {
-               blitText(TS_LOAD_GAME);
-               blitText(TS_CONTINUE_CURRENT_GAME);
+               screen_blitText(TS_CONTINUE_CURRENT_GAME);
        }
-       blitText(TS_OPTIONS);
+       screen_blitText(TS_OPTIONS);
        if (engine.cheat)
        {
-               textShape[TS_QUIT].y = 450;
-               blitText(TS_CHEAT_OPTIONS);
+               gfx_textSprites[TS_QUIT].y = screen->h / 3 + 150;
+               screen_blitText(TS_CHEAT_OPTIONS);
        }
        else
        {
-               textShape[TS_QUIT].y = 430;
+               gfx_textSprites[TS_QUIT].y = screen->h / 3 + 130;
        }
-       blitText(TS_QUIT);
+       screen_blitText(TS_QUIT);
 
        if (engine.cheat)
                return 6;
@@ -45,47 +45,53 @@ static signed char showGameMenu(signed char continueSaveSlot)
        return 5;
 }
 
-static signed char showLoadMenu()
+static int showLoadMenu()
 {
-       signed char rtn = 1;
+       int rtn = 1;
 
        for (int i = TS_SAVESLOT_0 ; i <= TS_SAVESLOT_5 ; i++)
        {
                rtn++;
-               if (textShape[i].image != NULL)
+               if (gfx_textSprites[i].image != NULL)
                {
-                       blitText(i);
-                       textShape[TS_BACK_TO_MAIN_MENU].y = textShape[i].y + 40;
+                       screen_blitText(i);
+                       gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = gfx_textSprites[i].y + 40;
                }
        }
-       blitText(TS_BACK_TO_MAIN_MENU);
+       screen_blitText(TS_BACK_TO_MAIN_MENU);
 
        return rtn;
 }
 
 static void createDifficultyMenu()
 {
-       textSurface(TS_START_GAME, "»Ï¤á¤ë", -1, 350, FONT_WHITE);
+       gfx_createTextObject(TS_START_GAME, "»Ï¤á¤ë",
+               -1, screen->h / 3 + 50, FONT_WHITE);
 
        if (game.difficulty == DIFFICULTY_EASY)
-               textSurface(TS_DIFFICULTY, "Æñ°×ÅÙ - ´Êñ", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_DIFFICULTY, "Æñ°×ÅÙ - ´Êñ",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else if (game.difficulty == DIFFICULTY_HARD)
-               textSurface(TS_DIFFICULTY, "Æñ°×ÅÙ - Æñ¤·¤¤", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_DIFFICULTY, "Æñ°×ÅÙ - Æñ¤·¤¤",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else if (game.difficulty == DIFFICULTY_NIGHTMARE)
-               textSurface(TS_DIFFICULTY, "Æñ°×ÅÙ - °­Ì´!", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_DIFFICULTY, "Æñ°×ÅÙ - °­Ì´!",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else if (game.difficulty == DIFFICULTY_ORIGINAL)
-               textSurface(TS_DIFFICULTY, "Æñ°×ÅÙ - ¥ª¥ê¥¸¥Ê¥ë", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_DIFFICULTY, "Æñ°×ÅÙ - µìÈÇ",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else
-               textSurface(TS_DIFFICULTY, "Æñ°×ÅÙ - ÉáÄÌ", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_DIFFICULTY, "Æñ°×ÅÙ - ÉáÄÌ",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
 }
 
-static signed char showDifficultyMenu()
+static int showDifficultyMenu()
 {
-       textShape[TS_BACK_TO_MAIN_MENU].y = 410;
+       gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = screen->h / 3 + 110;
 
-       blitText(TS_START_GAME);
-       blitText(TS_DIFFICULTY);
-       blitText(TS_BACK_TO_MAIN_MENU);
+       screen_blitText(TS_START_GAME);
+       screen_blitText(TS_DIFFICULTY);
+       screen_blitText(TS_BACK_TO_MAIN_MENU);
 
        return 3;
 }
@@ -93,35 +99,43 @@ static signed char showDifficultyMenu()
 static void createOptionsMenu()
 {
        if (engine.useSound)
-               textSurface(TS_SOUND, "¸ú²Ì²» - ON", -1, 350, FONT_WHITE);
+               gfx_createTextObject(TS_SOUND, "¸ú²Ì²» - ON",
+                       -1, screen->h / 3 + 50, FONT_WHITE);
        else
-               textSurface(TS_SOUND, "¸ú²Ì²» - OFF", -1, 350, FONT_WHITE);
+               gfx_createTextObject(TS_SOUND, "¸ú²Ì²» - OFF",
+                       -1, screen->h / 3 + 50, FONT_WHITE);
 
        if (engine.useMusic)
-               textSurface(TS_MUSIC, "²»³Ú - ON", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_MUSIC, "²»³Ú - ON",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else
-               textSurface(TS_MUSIC, "²»³Ú - OFF", -1, 370, FONT_WHITE);
+               gfx_createTextObject(TS_MUSIC, "²»³Ú - OFF",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
 
        if (engine.fullScreen)
-               textSurface(TS_FULLSCREEN, "¥Õ¥ë¥¹¥¯¥ê¡¼¥ó - ON", -1, 390, FONT_WHITE);
+               gfx_createTextObject(TS_FULLSCREEN, "¥Õ¥ë¥¹¥¯¥ê¡¼¥ó - ON",
+                       -1, screen->h / 3 + 90, FONT_WHITE);
        else
-               textSurface(TS_FULLSCREEN, "¥Õ¥ë¥¹¥¯¥ê¡¼¥ó - OFF", -1, 390, FONT_WHITE);
+               gfx_createTextObject(TS_FULLSCREEN, "¥Õ¥ë¥¹¥¯¥ê¡¼¥ó - OFF",
+                       -1, screen->h / 3 + 90, FONT_WHITE);
 
        if (engine.autoPause)
-               textSurface(TS_AUTOPAUSE, "¥ª¡¼¥È¥Ý¡¼¥º - ON", -1, 410, FONT_WHITE);
+               gfx_createTextObject(TS_AUTOPAUSE, "¥ª¡¼¥È¥Ý¡¼¥º - ON",
+                       -1, screen->h / 3 + 110, FONT_WHITE);
        else
-               textSurface(TS_AUTOPAUSE, "¥ª¡¼¥È¥Ý¡¼¥º - OFF", -1, 410, FONT_WHITE);
+               gfx_createTextObject(TS_AUTOPAUSE, "¥ª¡¼¥È¥Ý¡¼¥º - OFF",
+                       -1, screen->h / 3 + 110, FONT_WHITE);
 }
 
-static signed char showOptionsMenu()
+static int showOptionsMenu()
 {
-       textShape[TS_BACK_TO_MAIN_MENU].y = 450;
+       gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = screen->h / 3 + 150;
 
-       blitText(TS_SOUND);
-       blitText(TS_MUSIC);
-       blitText(TS_FULLSCREEN);
-       blitText(TS_AUTOPAUSE);
-       blitText(TS_BACK_TO_MAIN_MENU);
+       screen_blitText(TS_SOUND);
+       screen_blitText(TS_MUSIC);
+       screen_blitText(TS_FULLSCREEN);
+       screen_blitText(TS_AUTOPAUSE);
+       screen_blitText(TS_BACK_TO_MAIN_MENU);
 
        return 5;
 }
@@ -129,43 +143,43 @@ static signed char showOptionsMenu()
 static void createCheatMenu()
 {
        if (engine.cheatShield)
-               textSurface(TS_UNLIMITED_SHIELD, "̵À©¸Â¤Î¥·¡¼¥ë¥É - ON", -1, 350,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_SHIELD, "̵À©¸Â¤Î¥·¡¼¥ë¥É - ON",
+                       -1, screen->h / 3 + 50, FONT_WHITE);
        else
-               textSurface(TS_UNLIMITED_SHIELD, "̵À©¸Â¤Î¥·¡¼¥ë¥É - OFF", -1, 350,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_SHIELD, "̵À©¸Â¤Î¥·¡¼¥ë¥É - OFF",
+                       -1, screen->h / 3 + 50, FONT_WHITE);
 
        if (engine.cheatAmmo)
-               textSurface(TS_UNLIMITED_AMMO, "̵À©¸Â¤Î¥×¥é¥º¥Þ - ON", -1, 370,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_AMMO, "̵À©¸Â¤Î¥×¥é¥º¥Þ - ON",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
        else
-               textSurface(TS_UNLIMITED_AMMO, "̵À©¸Â¤Î¥×¥é¥º¥Þ - OFF", -1, 370,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_AMMO, "̵À©¸Â¤Î¥×¥é¥º¥Þ - OFF",
+                       -1, screen->h / 3 + 70, FONT_WHITE);
 
        if (engine.cheatCash)
-               textSurface(TS_UNLIMITED_CASH, "̵À©¸Â¤Î¥­¥ã¥Ã¥·¥å - ON", -1, 390,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_CASH, "̵À©¸Â¤Î¥­¥ã¥Ã¥·¥å - ON",
+                       -1, screen->h / 3 + 90, FONT_WHITE);
        else
-               textSurface(TS_UNLIMITED_CASH, "̵À©¸Â¤Î¥­¥ã¥Ã¥·¥å - OFF", -1, 390,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_CASH, "̵À©¸Â¤Î¥­¥ã¥Ã¥·¥å - OFF",
+                       -1, screen->h / 3 + 90, FONT_WHITE);
 
        if (engine.cheatTime)
-               textSurface(TS_UNLIMITED_TIME, "̵À©¸Â¤Î»þ´Ö - ON", -1, 410,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_TIME, "̵À©¸Â¤Î»þ´Ö - ON",
+                       -1, screen->h / 3 + 110, FONT_WHITE);
        else
-               textSurface(TS_UNLIMITED_TIME, "̵À©¸Â¤Î»þ´Ö - OFF", -1, 410,
-                       FONT_WHITE);
+               gfx_createTextObject(TS_UNLIMITED_TIME, "̵À©¸Â¤Î»þ´Ö - OFF",
+                       -1, screen->h / 3 + 110, FONT_WHITE);
 }
 
-static signed char showCheatMenu()
+static int showCheatMenu()
 {
-       textShape[TS_BACK_TO_MAIN_MENU].y = 450;
+       gfx_textSprites[TS_BACK_TO_MAIN_MENU].y = screen->h / 3 + 150;
 
-       blitText(TS_UNLIMITED_SHIELD);
-       blitText(TS_UNLIMITED_AMMO);
-       blitText(TS_UNLIMITED_CASH);
-       blitText(TS_UNLIMITED_TIME);
-       blitText(TS_BACK_TO_MAIN_MENU);
+       screen_blitText(TS_UNLIMITED_SHIELD);
+       screen_blitText(TS_UNLIMITED_AMMO);
+       screen_blitText(TS_UNLIMITED_CASH);
+       screen_blitText(TS_UNLIMITED_TIME);
+       screen_blitText(TS_BACK_TO_MAIN_MENU);
 
        return 5;
 }
@@ -176,12 +190,31 @@ This is the main title screen, with the stars whirling past and the
 */
 int doTitle()
 {
+       int continueSaveSlot;
+
+       int prx;
+       int pry;
+       int sfx;
+       int sfy;
+
+       int then;
+       int now;
+
+       int redGlow = 255;
+       int redDir = -2;
+       char buildVersion[25];
+
+       int selectedOption = 1;
+       bool skip = false;
+       int listLength = 5; // menu list length
+       int menuType = MENU_MAIN;
+
        game_init();
 
        engine.gameSection = SECTION_TITLE;
 
-       flushBuffer();
-       freeGraphics();
+       screen_flushBuffer();
+       gfx_free();
        resetLists();
        
        // required to stop the title screen crashing
@@ -190,37 +223,44 @@ int doTitle()
 
        loadGameGraphics();
 
-       clearScreen(black);
-       updateScreen();
-       clearScreen(black);
+       screen_clear(black);
+       renderer_update();
+       screen_clear(black);
 
-       signed char continueSaveSlot = initSaveSlots();
+       continueSaveSlot = initSaveSlots();
 
        loadBackground("gfx/spirit.jpg");
 
        SDL_Surface *prlogo, *sflogo;
-       prlogo = loadImage("gfx/prlogo.png");
-       sflogo = loadImage("gfx/sflogo.png");
-
-       int prx = ((screen->w - prlogo->w) / 2);
-       int pry = ((screen->h - prlogo->h) / 2);
-
-       int sfx = ((screen->w - sflogo->w) / 2);
-       int sfy = ((screen->h - sflogo->h) / 2);
-
-       textSurface(TS_PRESENTS, "PRESENTS", -1, 300, FONT_WHITE);
-       textSurface(TS_AN_SDL_GAME, "AN SDL GAME", -1, 300, FONT_WHITE);
-       textSurface(TS_START_NEW_GAME, "»Ï¤á¤«¤é", -1, 350, FONT_WHITE);
-       textSurface(TS_LOAD_GAME, "¥í¡¼¥É", -1, 370, FONT_WHITE);
-       textSurface(TS_CONTINUE_CURRENT_GAME, "³¤­", -1, 390,
-               FONT_WHITE);
-       textSurface(TS_OPTIONS, "¥ª¥×¥·¥ç¥ó", -1, 410, FONT_WHITE);
-       textSurface(TS_CHEAT_OPTIONS, "¥Á¡¼¥È¥ª¥×¥·¥ç¥ó", -1, 430, FONT_WHITE);
-       textSurface(TS_QUIT, "½ªÎ»", -1, 430, FONT_WHITE);
+       prlogo = gfx_loadImage("gfx/prlogo.png");
+       sflogo = gfx_loadImage("gfx/sflogo.png");
+
+       prx = ((screen->w - prlogo->w) / 2);
+       pry = ((screen->h - prlogo->h) / 2);
+
+       sfx = ((screen->w - sflogo->w) / 2);
+       sfy = ((screen->h - sflogo->h) / 3);
+
+       gfx_createTextObject(TS_PRESENTS, "PRESENTS",
+               -1, screen->h / 2, FONT_WHITE);
+       gfx_createTextObject(TS_AN_SDL_GAME, "AN SDL GAME",
+               -1, screen->h / 2, FONT_WHITE);
+       gfx_createTextObject(TS_START_NEW_GAME, "ºÇ½é¤«¤é",
+               -1, screen->h / 3 + 50, FONT_WHITE);
+       gfx_createTextObject(TS_LOAD_GAME, "¥í¡¼¥É",
+               -1, screen->h / 3 + 70, FONT_WHITE);
+       gfx_createTextObject(TS_CONTINUE_CURRENT_GAME, "³¤­",
+               -1, screen->h / 3 + 90, FONT_WHITE);
+       gfx_createTextObject(TS_OPTIONS, "¥ª¥×¥·¥ç¥ó",
+               -1, screen->h / 3 + 110, FONT_WHITE);
+       gfx_createTextObject(TS_CHEAT_OPTIONS, "¥Á¡¼¥È¥ª¥×¥·¥ç¥ó",
+               -1, screen->h / 3 + 130, FONT_WHITE);
+       gfx_createTextObject(TS_QUIT, "½ªÎ»",
+               -1, screen->h / 3 + 130, FONT_WHITE);
 
        createOptionsMenu();
        createDifficultyMenu();
-       textSurface(TS_BACK_TO_MAIN_MENU, "¥á¥¤¥ó¥á¥Ë¥å¡¼¤ËÌá¤ë", -1, 0, FONT_WHITE);
+       gfx_createTextObject(TS_BACK_TO_MAIN_MENU, "¥á¥¤¥ó¥á¥Ë¥å¡¼¤ËÌá¤ë", -1, 0, FONT_WHITE);
 
        createCheatMenu();
 
@@ -230,8 +270,7 @@ int doTitle()
        engine.smx = 0;
        engine.smy = 0;
 
-       int then = SDL_GetTicks();
-       int now;
+       then = SDL_GetTicks();
 
        for (int i = 0 ; i < 15 ; i++)
        {
@@ -246,27 +285,22 @@ int doTitle()
                aliens[i].face = 0;
        }
 
-       int redGlow = 255;
-       signed char redDir = -2;
-       char buildVersion[25];
        sprintf(buildVersion, "Version "VERSION);
 
        SDL_Rect optionRec;
 
-       optionRec.x = 290;
-       optionRec.y = 345;
+       optionRec.x = screen->w / 2 - 110;
+       optionRec.y = screen->h / 3 + 45;
        optionRec.h = 22;
        optionRec.w = 215;
 
-       signed char selectedOption = 1;
-       if (continueSaveSlot > -1)
-               {selectedOption = 3; optionRec.y += 40;}
-
-       bool skip = false;
-       signed char listLength = 5; // menu list length
-       signed char menuType = MENU_MAIN;
+       if (continueSaveSlot != -1)
+       {
+               selectedOption = 3;
+               optionRec.y += 40;
+       }
 
-       drawBackGround();
+       screen_drawBackground();
 
        engine.done = 0;
        flushInput();
@@ -276,20 +310,20 @@ int doTitle()
 
        while (!engine.done)
        {
-               updateScreen();
-               unBuffer();
+               renderer_update();
+               screen_unBuffer();
 
                now = SDL_GetTicks();
 
-               doStarfield();
+               game_doStars();
                game_doExplosions();
 
                for (int i = 0 ; i < 15 ; i++)
                {
                        explosion_addEngine(&aliens[i]);
                        aliens[i].x += aliens[i].dx;
-                       blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
-                       if (aliens[i].x > 830)
+                       screen_blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
+                       if (aliens[i].x > screen->w + 30)
                        {
                                aliens[i].x = -40;
                                aliens[i].y = rand() % (screen->h - 20);
@@ -299,25 +333,25 @@ int doTitle()
 
                if ((now - then > 2000) && (now - then < 8000) && (!skip))
                {
-                       blit(prlogo, prx, pry);
+                       screen_blit(prlogo, prx, pry);
                }
                else if ((now - then > 9000) && (now - then < 15000) && (!skip))
                {
-                       blitText(TS_PRESENTS);
+                       screen_blitText(TS_PRESENTS);
                }
                else if ((now - then > 16000) && (now - then < 21000) && (!skip))
                {
-                       blitText(TS_AN_SDL_GAME);
+                       screen_blitText(TS_AN_SDL_GAME);
                }
                else if ((now - then > 25500) || (skip))
                {
-                       blit(sflogo, sfx, sfy);
+                       screen_blit(sflogo, sfx, sfy);
 
                        if ((now - then >= 27500) || (skip))
                        {
-                               addBuffer(0, 0, screen->w, screen->h);
+                               screen_addBuffer(0, 0, screen->w, screen->h);
 
-                               blevelRect(optionRec.x, optionRec.y, optionRec.w, optionRec.h, redGlow, 0x00, 0x00);
+                               screen_drawRect(optionRec.x, optionRec.y, optionRec.w, optionRec.h, redGlow, 0x00, 0x00);
 
                                switch(menuType)
                                {
@@ -347,31 +381,36 @@ int doTitle()
                                        engine.keyState[KEY_UP] = 0;
                                        WRAP_ADD(selectedOption, -1, 1, listLength + 1);
                                        if (menuType == MENU_MAIN)
-                                               if ((selectedOption == 2) || (selectedOption == 3))
+                                               if (selectedOption == 3)
                                                        if (continueSaveSlot == -1)
-                                                               selectedOption = 1;
+                                                               selectedOption = 2;
                                }
                                if (engine.keyState[KEY_DOWN])
                                {
                                        engine.keyState[KEY_DOWN] = 0;
                                        WRAP_ADD(selectedOption, 1, 0, listLength);
                                        if (menuType == MENU_MAIN)
-                                               if ((selectedOption == 2) || (selectedOption == 3))
+                                               if (selectedOption == 3)
                                                        if (continueSaveSlot == -1)
                                                                selectedOption = 4;
                                }
 
-                               optionRec.y = 326 + (20 * selectedOption);
+                               optionRec.y = screen->h / 3 + 26 + (20 * selectedOption);
                                if (menuType > MENU_MAIN)
                                        if (selectedOption == listLength)
                                                optionRec.y += 20;
 
                                if (!skip)
                                {
-                                       drawString("Copyright Parallel Realities 2003", 5, 560, FONT_WHITE, background);
-                                       drawString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012", 5, 580, FONT_WHITE, background);
-                                       drawString(buildVersion, 794 - strlen(buildVersion) * 9, 580, FONT_WHITE, background);
-                                       addBuffer(0, 560, 800, 40);
+                                       gfx_renderString("Copyright Parallel Realities 2003",
+                                               5, screen->h - 60, FONT_WHITE, 0, gfx_background);
+                                       gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
+                                               5, screen->h - 40, FONT_WHITE, 0, gfx_background);
+                                       gfx_renderString("Copyright 2015, 2016 onpon4",
+                                               5, screen->h - 20, FONT_WHITE, 0, gfx_background);
+                                       gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9,
+                                               screen->h - 20, FONT_WHITE, 0, gfx_background);
+                                       screen_addBuffer(0, 0, screen->w, screen->h);
                                        skip = true;
                                }
                        }
@@ -390,10 +429,15 @@ int doTitle()
                {
                        if ((now - then <= 27500) && (!skip))
                        {
-                               drawString("Copyright Parallel Realities 2003", 5, 560, FONT_WHITE, background);
-                               drawString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012", 5, 580, FONT_WHITE, background);
-                               drawString(buildVersion, 794 - strlen(buildVersion) * 9, 580, FONT_WHITE, background);
-                               addBuffer(0, 560, 800, 40);
+                               gfx_renderString("Copyright Parallel Realities 2003",
+                                       5, screen->h - 60, FONT_WHITE, 0, gfx_background);
+                               gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012",
+                                       5, screen->h - 40, FONT_WHITE, 0, gfx_background);
+                               gfx_renderString("Copyright 2015, 2016 onpon4",
+                                       5, screen->h - 20, FONT_WHITE, 0, gfx_background);
+                               gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9,
+                                       screen->h - 20, FONT_WHITE, 0, gfx_background);
+                               screen_addBuffer(0, 560, 800, 40);
                                skip = true;
                        }
                        else
@@ -524,7 +568,7 @@ int doTitle()
                        engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
                }
 
-               delayFrame();
+               game_delayFrame();
        }
 
        audio_haltMusic();
@@ -563,7 +607,7 @@ Scrolls the intro text up the screen and nothing else.
 */
 void showStory()
 {
-       freeGraphics();
+       gfx_free();
 
        int y = screen->h + 20;
 
@@ -571,43 +615,45 @@ void showStory()
 
        fp = fopen("data/intro.txt", "rb");
 
-       int i = 0;
+       int index = 0;
        int nextPos = -1;
        char string[255];
 
        while (fscanf(fp, "%d %[^\n]%*c", &nextPos, string) == 2)
        {
                y += nextPos;
-               textSurface(i, string, -1, y, FONT_WHITE);
+               gfx_createTextObject(index, string, -1, y, FONT_WHITE);
 
-               i++;
+               index++;
        }
 
        fclose(fp);
 
        loadBackground("gfx/startUp.jpg");
-       blit(background, 0, 0);
-       flushBuffer();
+       screen_drawBackground();
+       screen_flushBuffer();
 
        flushInput();
        engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
 
        while (true)
        {
-               updateScreen();
-               unBuffer();
+               renderer_update();
+               screen_unBuffer();
 
                getPlayerInput();
 
                if ((engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE]))
                        break;
 
-               if (textShape[8].y > (screen->h / 2) + 150)
+               // XXX: The fact that it's line 8 that's watched is completely
+               // arbitrary. It might be prudent to replace this with something else.
+               if (gfx_textSprites[8].y > (screen->h / 2) + 150)
                {
                        for (int i = 0 ; i < 9 ; i++)
                        {
-                               textShape[i].y -= 0.33333;
-                               blitText(i);
+                               gfx_textSprites[i].y -= 0.33333;
+                               screen_blitText(i);
                        }
                }
                else
@@ -616,7 +662,7 @@ void showStory()
                        break;
                }
 
-               delayFrame();
+               game_delayFrame();
        }
 }
 
@@ -625,18 +671,18 @@ The game over screen :(
 */
 void gameover()
 {
-       flushBuffer();
-       freeGraphics();
-       SDL_FillRect(background, NULL, black);
+       screen_flushBuffer();
+       gfx_free();
+       SDL_FillRect(gfx_background, NULL, black);
 
        engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
        engine.gameSection = SECTION_INTERMISSION;
 
-       SDL_Surface *gameover = loadImage("gfx/gameover.png");
+       SDL_Surface *gameover = gfx_loadImage("gfx/gameover.png");
 
-       clearScreen(black);
-       updateScreen();
-       clearScreen(black);
+       screen_clear(black);
+       renderer_update();
+       screen_clear(black);
        SDL_Delay(1000);
 
        audio_playMusic("music/death.ogg", -1);
@@ -644,7 +690,7 @@ void gameover()
        int x = (screen->w - gameover->w) / 2;
        int y = (screen->h - gameover->h) / 2;
 
-       updateScreen();
+       renderer_update();
 
        flushInput();
        engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
@@ -656,26 +702,26 @@ void gameover()
                if (engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE])
                        break;
 
-               updateScreen();
+               renderer_update();
 
-               unBuffer();
+               screen_unBuffer();
                x = ((screen->w - gameover->w) / 2) - RANDRANGE(-2, 2);
                y = ((screen->h - gameover->h) / 2)  - RANDRANGE(-2, 2);
-               blit(gameover, x,  y);
+               screen_blit(gameover, x,  y);
 
-               delayFrame();
+               game_delayFrame();
        }
 
        SDL_FreeSurface(gameover);
        audio_haltMusic();
-       flushBuffer();
+       screen_flushBuffer();
 }
 
 void doCredits()
 {
        loadBackground("gfx/credits.jpg");
-       flushBuffer();
-       freeGraphics();
+       screen_flushBuffer();
+       gfx_free();
 
        FILE *fp;
        int lastCredit = -1;
@@ -687,11 +733,11 @@ void doCredits()
 
        textObject *credit;
 
-       clearScreen(black);
-       updateScreen();
-       clearScreen(black);
+       screen_clear(black);
+       renderer_update();
+       screen_clear(black);
 
-       drawBackGround();
+       screen_drawBackground();
 
        audio_playMusic("music/rise_of_spirit.ogg", 1);
 
@@ -704,7 +750,7 @@ void doCredits()
        while (fscanf(fp, "%d %[^\n]%*c", &yPos, text) == 2)
        {
                lastCredit++;
-               credit[lastCredit].image = textSurface(text, FONT_WHITE);
+               credit[lastCredit].image = gfx_createTextSurface(text, FONT_WHITE);
                credit[lastCredit].x = (screen->w - credit[lastCredit].image->w) / 2;
                yPos2 += yPos;
                credit[lastCredit].y = yPos2;
@@ -721,8 +767,8 @@ void doCredits()
 
        while (true)
        {
-               updateScreen();
-               unBuffer();
+               renderer_update();
+               screen_unBuffer();
 
                getPlayerInput();
                if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] ||
@@ -738,14 +784,14 @@ void doCredits()
                for (i = 0 ; i <= lastCredit ; i++)
                {
                        if ((credit[i].y > -10) && (credit[i].y < (screen->h + 10)))
-                               blit(credit[i].image, (int)credit[i].x, (int)credit[i].y);
+                               screen_blit(credit[i].image, (int)credit[i].x, (int)credit[i].y);
                        if (speed > 0 && credit[lastCredit].y > ((screen->h / 2) + 100))
                                credit[i].y -= speed;
                        else if(speed < 0 && credit[0].y < screen->h)
                                credit[i].y -= speed;
                }
 
-               delayFrame();
+               game_delayFrame();
        }
 
        for (i = 0 ; i <= lastCredit ; i++)
index 316cae3..804801d 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
index 79be417..cc6450d 100644 (file)
@@ -1,6 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011, 2013 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -18,16 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "Starfighter.h"
 
-object weapon[MAX_WEAPONS];
-
-void setWeaponShapes()
-{
-       for (int i = 0 ; i < MAX_WEAPONS ; i++)
-       {
-               weapon[i].image[0] = shape[weapon[i].imageIndex[0]];
-               weapon[i].image[1] = shape[weapon[i].imageIndex[1]];
-       }
-}
+object weapon[W_MAX];
 
 /*
 A list of predefined weaponary.
@@ -40,8 +32,8 @@ void initWeapons()
        weapon[W_PLAYER_WEAPON].damage = 1;
        weapon[W_PLAYER_WEAPON].reload[0] = 15;
        weapon[W_PLAYER_WEAPON].speed = 10;
-       weapon[W_PLAYER_WEAPON].imageIndex[0] = 0;
-       weapon[W_PLAYER_WEAPON].imageIndex[1] = 0;
+       weapon[W_PLAYER_WEAPON].imageIndex[0] = SP_PLASMA_GREEN;
+       weapon[W_PLAYER_WEAPON].imageIndex[1] = SP_PLASMA_GREEN;
        weapon[W_PLAYER_WEAPON].flags = WF_SPREAD;
 
        // Single Shot
@@ -50,8 +42,8 @@ void initWeapons()
        weapon[W_SINGLE_SHOT].damage = 1;
        weapon[W_SINGLE_SHOT].reload[0] = 15;
        weapon[W_SINGLE_SHOT].speed = 10;
-       weapon[W_SINGLE_SHOT].imageIndex[0] = 0;
-       weapon[W_SINGLE_SHOT].imageIndex[1] = 1;
+       weapon[W_SINGLE_SHOT].imageIndex[0] = SP_PLASMA_GREEN;
+       weapon[W_SINGLE_SHOT].imageIndex[1] = SP_PLASMA_RED;
        weapon[W_SINGLE_SHOT].flags = 0;
 
        // Double Shot
@@ -69,8 +61,8 @@ void initWeapons()
        weapon[W_ROCKETS].reload[0] = 45;
        weapon[W_ROCKETS].speed = 20;
        weapon[W_ROCKETS].flags = 0;
-       weapon[W_ROCKETS].imageIndex[0] = 2;
-       weapon[W_ROCKETS].imageIndex[1] = 3;
+       weapon[W_ROCKETS].imageIndex[0] = SP_ROCKET;
+       weapon[W_ROCKETS].imageIndex[1] = SP_ROCKET_L;
 
        // Double Rockets (uses ROCKETS as base)
        weapon[W_DOUBLE_ROCKETS] = weapon[W_ROCKETS];
@@ -84,8 +76,8 @@ void initWeapons()
        weapon[W_MICRO_ROCKETS].reload[0] = 30;
        weapon[W_MICRO_ROCKETS].speed = 15;
        weapon[W_MICRO_ROCKETS].flags = WF_VARIABLE_SPEED;
-       weapon[W_MICRO_ROCKETS].imageIndex[0] = 2;
-       weapon[W_MICRO_ROCKETS].imageIndex[1] = 3;
+       weapon[W_MICRO_ROCKETS].imageIndex[0] = SP_ROCKET;
+       weapon[W_MICRO_ROCKETS].imageIndex[1] = SP_ROCKET_L;
 
        // Energy Ray
        weapon[W_ENERGYRAY].id = WT_ENERGYRAY;
@@ -93,6 +85,8 @@ void initWeapons()
        weapon[W_ENERGYRAY].damage = 1;
        weapon[W_ENERGYRAY].reload[0] = 25; // reload for energy ray is never used
        weapon[W_ENERGYRAY].speed = 15;
+       weapon[W_ENERGYRAY].imageIndex[0] = SP_PLASMA_RED;
+       weapon[W_ENERGYRAY].imageIndex[1] = SP_PLASMA_RED;
        weapon[W_ENERGYRAY].flags = 0;
 
        // Laser
@@ -101,8 +95,8 @@ void initWeapons()
        weapon[W_LASER].damage = 3;
        weapon[W_LASER].reload[0] = 1;
        weapon[W_LASER].speed = 10;
-       weapon[W_LASER].imageIndex[0] = 1;
-       weapon[W_LASER].imageIndex[1] = 1;
+       weapon[W_LASER].imageIndex[0] = SP_PLASMA_RED;
+       weapon[W_LASER].imageIndex[1] = SP_PLASMA_RED;
        weapon[W_LASER].flags = 0;
 
        // Beam up weapon
@@ -112,8 +106,8 @@ void initWeapons()
        weapon[W_CHARGER].reload[0] = 0;
        weapon[W_CHARGER].speed = 12;
        weapon[W_CHARGER].flags = 0;
-       weapon[W_CHARGER].imageIndex[0] = 33;
-       weapon[W_CHARGER].imageIndex[1] = 34;
+       weapon[W_CHARGER].imageIndex[0] = SP_DIR_PLASMA_GREEN;
+       weapon[W_CHARGER].imageIndex[1] = SP_DIR_PLASMA_RED;
 
        // Homing missile
        weapon[W_HOMING_MISSILE].id = WT_ROCKET;
@@ -122,15 +116,15 @@ void initWeapons()
        weapon[W_HOMING_MISSILE].reload[0] = 35;
        weapon[W_HOMING_MISSILE].speed = 10;
        weapon[W_HOMING_MISSILE].flags = WF_HOMING;
-       weapon[W_HOMING_MISSILE].imageIndex[0] = 4;
-       weapon[W_HOMING_MISSILE].imageIndex[1] = 4;
+       weapon[W_HOMING_MISSILE].imageIndex[0] = SP_SMALL_EXPLOSION;
+       weapon[W_HOMING_MISSILE].imageIndex[1] = SP_SMALL_EXPLOSION;
 
        // Double homing missile
        weapon[W_DOUBLE_HOMING_MISSILES] = weapon[W_HOMING_MISSILE];
        weapon[W_DOUBLE_HOMING_MISSILES].ammo[0] = 2;
        weapon[W_DOUBLE_HOMING_MISSILES].reload[0] = 65;
-       weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[0] = 4;
-       weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[1] = 4;
+       weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[0] = SP_SMALL_EXPLOSION;
+       weapon[W_DOUBLE_HOMING_MISSILES].imageIndex[1] = SP_SMALL_EXPLOSION;
 
        // Micro homing missiles
        weapon[W_MICRO_HOMING_MISSILES].id = WT_ROCKET;
@@ -139,8 +133,8 @@ void initWeapons()
        weapon[W_MICRO_HOMING_MISSILES].reload[0] = 65;
        weapon[W_MICRO_HOMING_MISSILES].speed = 3;
        weapon[W_MICRO_HOMING_MISSILES].flags = WF_HOMING;
-       weapon[W_MICRO_HOMING_MISSILES].imageIndex[0] = 4;
-       weapon[W_MICRO_HOMING_MISSILES].imageIndex[1] = 4;
+       weapon[W_MICRO_HOMING_MISSILES].imageIndex[0] = SP_SMALL_EXPLOSION;
+       weapon[W_MICRO_HOMING_MISSILES].imageIndex[1] = SP_SMALL_EXPLOSION;
 
        // Aimed plasma bolt
        weapon[W_AIMED_SHOT].id = WT_DIRECTIONAL;
@@ -149,8 +143,8 @@ void initWeapons()
        weapon[W_AIMED_SHOT].reload[0] = 15;
        weapon[W_AIMED_SHOT].speed = 0;
        weapon[W_AIMED_SHOT].flags = WF_AIMED;
-       weapon[W_AIMED_SHOT].imageIndex[0] = 33;
-       weapon[W_AIMED_SHOT].imageIndex[1] = 34;
+       weapon[W_AIMED_SHOT].imageIndex[0] = SP_DIR_PLASMA_GREEN;
+       weapon[W_AIMED_SHOT].imageIndex[1] = SP_DIR_PLASMA_RED;
 
        // 3 way spread weapon
        weapon[W_SPREADSHOT].id = WT_SPREAD;
@@ -159,8 +153,8 @@ void initWeapons()
        weapon[W_SPREADSHOT].reload[0] = 10;
        weapon[W_SPREADSHOT].speed = 10;
        weapon[W_SPREADSHOT].flags = WF_SPREAD;
-       weapon[W_SPREADSHOT].imageIndex[0] = 0;
-       weapon[W_SPREADSHOT].imageIndex[1] = 1;
+       weapon[W_SPREADSHOT].imageIndex[0] = SP_PLASMA_GREEN;
+       weapon[W_SPREADSHOT].imageIndex[1] = SP_PLASMA_RED;
 
        // Sid's ion cannon like weapon
        weapon[W_IONCANNON].id = WT_PLASMA;
@@ -169,8 +163,8 @@ void initWeapons()
        weapon[W_IONCANNON].reload[0] = 2;
        weapon[W_IONCANNON].speed = 10;
        weapon[W_IONCANNON].flags = WF_DISABLE | WF_AIMED;
-       weapon[W_IONCANNON].imageIndex[0] = 35;
-       weapon[W_IONCANNON].imageIndex[1] = 35;
+       weapon[W_IONCANNON].imageIndex[0] = SP_ION;
+       weapon[W_IONCANNON].imageIndex[1] = SP_ION;
 
        // Directional Shock Missile - Used by Kline in final battle
        weapon[W_DIRSHOCKMISSILE].id = WT_ROCKET;
@@ -179,6 +173,6 @@ void initWeapons()
        weapon[W_DIRSHOCKMISSILE].reload[0] = 60;
        weapon[W_DIRSHOCKMISSILE].speed = 0;
        weapon[W_DIRSHOCKMISSILE].flags = WF_AIMED | WF_TIMEDEXPLOSION;
-       weapon[W_DIRSHOCKMISSILE].imageIndex[0] = 4;
-       weapon[W_DIRSHOCKMISSILE].imageIndex[1] = 4;
+       weapon[W_DIRSHOCKMISSILE].imageIndex[0] = SP_SMALL_EXPLOSION;
+       weapon[W_DIRSHOCKMISSILE].imageIndex[1] = SP_SMALL_EXPLOSION;
 }
index 0fd8493..740ae16 100644 (file)
@@ -1,7 +1,7 @@
 /*
 Copyright (C) 2003 Parallel Realities
 Copyright (C) 2011 Guus Sliepen
-Copyright (C) 2015 Julian Marchant
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -20,9 +20,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef WEAPONS_H
 #define WEAPONS_H
 
-extern object weapon[MAX_WEAPONS];
+extern object weapon[W_MAX];
 
-extern void setWeaponShapes();
 extern void initWeapons();
 
 #endif
diff --git a/src/window.cpp b/src/window.cpp
new file mode 100644 (file)
index 0000000..3a17242
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011, 2012, 2013 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "SDL.h"
+
+SDL_Window *window;
diff --git a/src/window.h b/src/window.h
new file mode 100644 (file)
index 0000000..94041b8
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+Copyright (C) 2003 Parallel Realities
+Copyright (C) 2011 Guus Sliepen
+Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 3
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef WINDOW_H
+#define WINDOW_H
+
+extern SDL_Window *window;
+
+#endif