Description: More fixes for D language changes
  With this patch the code is accepted by gdc-8 8-20180414-1 without
  triggering deprecated feature warnings.
  - Convert I/O to use std.stdio module
  - Fix some unused broken code by deleting it
  - Avoid C-style array type notation
  - Use "goto case" to mark fall-through in switch statements
Author: Peter De Wachter <pdewacht@gmail.com>
Forwarded: no

--- a/src/br/boss.d
+++ b/src/br/boss.d
@@ -1026,6 +1026,7 @@
 				addAnimation(new Magnification(500 ,100.0f) ,"mag");
 				changeState("startA");
 			}
+			break;
 			default:break;
 		}
 		
--- a/src/br/bullet.d
+++ b/src/br/bullet.d
@@ -164,6 +164,7 @@
 			switch(kind){
 				case CollisionManager.kind.SHIP:
 				destroy();
+				goto case;
 				case CollisionManager.kind.WALL:
 				if(re <= 0){
 					if(vel.x<0)pos = new Vector3(p.pos.x+(p.collisionRange+collisionRange) ,pos.y ,pos.z);
@@ -228,6 +229,7 @@
 			switch(kind){
 				case CollisionManager.kind.SHIP:
 				destroy();
+				goto case;
 				case CollisionManager.kind.WALL:
 				if(!hit){
 					if(vel.x<0){
--- a/src/br/enemy.d
+++ b/src/br/enemy.d
@@ -773,7 +773,7 @@
 //		this.acc = (cast(Vector3)vel.clone()) * -0.01f;
 		
 		if(ENEMYDSHAPE is null){
-			Shape s = OctaShape.getShape(1.0f ,1.0f).transformMatrix(matRotateZ(-90));;
+			Shape s = OctaShape.getShape(1.0f ,1.0f).transformMatrix(matRotateZ(-90));
 			Shape s1 = OctaShape.getShape(0.6f ,3.0f).scalef(0.8f,0.8f,0.8f).transformMatrix(matTranslate(1.5f,0.0f,0.0f)*matRotateZ(45));
 			Shape s2 = OctaShape.getShape(0.6f ,3.0f).scalef(0.8f,0.8f,0.8f).transformMatrix(matTranslate(1.5f,0.0f,0.0f)*matRotateZ(135));
 			ENEMYDSHAPE = s + s1 + s2;
--- a/src/br/wall.d
+++ b/src/br/wall.d
@@ -10,7 +10,7 @@
 
 public void makeWall(string type ,Vector3 pos ,Vector3 vel ,Object par = null){
 	switch(type){
-		case "1" : new Wall1(pos ,vel);
+		case "1" : new Wall1(pos ,vel); break;
 		
 		default:break;
 	}
--- a/src/util/log.d
+++ b/src/util/log.d
@@ -3,11 +3,11 @@
 private import std.conv;
 private import std.file;
 private import std.path;
-private import std.cstream;
+private import std.stdio;
 static const string g_logname = "run.log";
 void Log_write(string msg)
 {
-	std.cstream.dout.writeLine(msg);
+	stdout.writeln(msg);
 	append(g_logname, msg ~ "\n");
 }
 void Log_write(int msg)
@@ -17,6 +17,6 @@
 }
 void Log_write(Exception e)
 {
-	std.cstream.dout.writeLine(e.toString());
+	stdout.writeln(e.toString());
 	append(g_logname, e.toString() ~ "\n");
 }
--- a/src/util/mouse.d
+++ b/src/util/mouse.d
@@ -6,7 +6,6 @@
 module util.mouse;
 
 private import std.string;
-private import std.stream;
 private import SDL;
 
 private import br.screen;
@@ -107,18 +106,6 @@
     button = 0;
   }
 
-  public void read(File fd) {
-    fd.read(x);
-    fd.read(y);
-    fd.read(button);
-  }
-
-  public void write(File fd) {
-    fd.write(x);
-    fd.write(y);
-    fd.write(button);
-  }
-
   public bool equals(MouseState s) {
     if (x == s.x && y == s.y && button == s.button)
       return true;
--- a/src/util/rand.d
+++ b/src/util/rand.d
@@ -5,7 +5,6 @@
  */
 module util.rand;
 
-private import std.stream;
 private import std.datetime;
 
 /**
@@ -112,7 +111,7 @@
 uint MIXBITS(uint u, uint v) { return (u & UMASK) | (v & LMASK); }
 uint TWIST(uint u,uint v) { return (MIXBITS(u,v) >> 1) ^ (v&1 ? MATRIX_A : 0); }
 
-uint state[N]; /* the array for the state vector  */
+uint[N] state; /* the array for the state vector  */
 int left = 1;
 int initf = 0;
 uint *next;
@@ -137,7 +136,7 @@
 /* key_length is its length */
 //uint init_key[];
 //uint key_length;
-void init_by_array(uint init_key[], uint key_length)
+void init_by_array(uint[] init_key, uint key_length)
 {
     int i, j, k;
     init_genrand(cast(uint)19650218UL);
--- a/src/util/record.d
+++ b/src/util/record.d
@@ -1,5 +1,4 @@
 module util.record;
-private import std.stream;
 
 public class Record{
 	
@@ -32,30 +31,6 @@
 			}
 		}
 	}
-	public void load(File fd){
-		foreach(ref int[] lap;lapTime){
-			foreach(ref int l;lap){
-				fd.read(l);
-			}
-		}
-		foreach(ref int[] total;totalTime){
-			foreach(ref int t;total){
-				fd.read(t);
-			}
-		}
-	}
-	public void save(File fd){
-		foreach(ref int[] lap;lapTime){
-			foreach(ref int l;lap){
-				fd.write(l);
-			}
-		}
-		foreach(ref int[] total;totalTime){
-			foreach(ref int t;total){
-				fd.write(t);
-			}
-		}
-	}
 	public int updateLapRecord(int stage ,int lap){
 		int rank = -1;
 		if(lapTime.length <= stage)return -1;
--- a/import/hell2.d
+++ b/import/hell2.d
@@ -1,10 +1,8 @@
 module hell2;
-private import core.vararg;
 private import std.string;
 private import std.conv;
 private import std.file;
 private import std.path;
-private import std.cstream;
 private import std.ascii;
 private import std.math;
 private import std.format;
@@ -186,79 +184,6 @@
 }
 
 /**
- * SDL初期化
- */
-void Hell_init(string caption, int width=640, int height=480, bool fullscreen=false)
-{
-	if(g_init) return;
-	g_width      = width;
-	g_height     = height;
-	g_videoBpp   = 0;
-	g_videoFlags = SDL_OPENGL;
-	if(fullscreen)
-	{
-		g_videoFlags |= SDL_FULLSCREEN;
-	}
-	
-	if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0)
-	{
-		throw new Error("Hell_init: Couldn't initialize SDL");
-	}
-	// スクリーン初期化
-	if((g_screen = SDL_SetVideoMode(g_width, g_height, g_videoBpp, g_videoFlags)) is null)
-	{
-		throw new Error("Hell_init: Couldn't set video mode");
-	}
-	if(fullscreen)
-	{
-		_toggleShowCursor(); // フルスクリーン時はマウスカーソルを消す
-	}
-	
-	glOrtho(0, g_width, g_height, 0, -1, 1); 
-	glViewport(0, 0, g_width, g_height);
-	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-	Hell_setCaption(caption);
-	// アイコン設定
-	SDL_Surface* icon = SDL_LoadBMP("resource/hell.bmp");
-	SDL_WM_SetIcon(icon, null);
-	// サウンド初期化（音を良くしたい場合、下のコメントを外す）
-//	if(Mix_OpenAudio(44100, AUDIO_S16, 2, 8192) < 0)
-	if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024) < 0)
-	{
-		throw new Error("Hell_init: " ~ to!string(SDL_GetError()));
-	}
-	
-	// ログ初期化
-	write(g_logname, "");
-	if(SDL_NumJoysticks() > 0)
-	{
-		// ジョイスティック生成
-		g_joy = SDL_JoystickOpen(0);
-		if(!g_joy)
-		{
-			throw new Error(to!string(SDL_GetError()));
-		}
-		g_joyButtonNum = SDL_JoystickNumButtons(g_joy);
-		g_joyButtonPrev = new bool[g_joyButtonNum];
-		g_joyButton = new bool[g_joyButtonNum];
-	}
-	else
-	{
-		g_joy = null;
-		g_joyButtonNum = 0;
-	}
-	
-	// フォントの読込
-	Hell_loadFont();
-	
-	// 曲面オブジェクト生成
-//	g_quadricObj = gluNewQuadric();
-	
-	glEnable(GL_BLEND);
-	g_init = true;
-}
-
-/**
  * 終了処理
  */
 void Hell_quit()
@@ -283,42 +208,6 @@
 }
 
 /**
- * キャプション設定（※日本語不可）
- */
-void Hell_setCaption(...)
-{
-	string _caption = "";
-	void _putc(dchar c)
-	{
-		scope tmp = [c];
-		_caption ~= toUTF8(tmp);
-	}
-	doFormat(&_putc, _arguments, _argptr);
-	SDL_WM_SetCaption(toStringz(_caption), null);
-}
-
-
-/**
- * ログ書き込み
- */
-void Hell_write(...)
-{
-	void _putc(dchar c)
-	{
-		fputc(c, stdout);
-		scope tmp = [c];
-		append(g_logname, toUTF8(tmp));
-	}
-	doFormat(&_putc, _arguments, _argptr);
-}
-
-void Hell_write(Exception e)
-{
-	dout.writeLine(e.toString());
-	append(g_logname, e.toString() ~ "\n");
-}
-
-/**
  * 画面を消去
  */
 void Hell_begin()
@@ -952,18 +841,6 @@
 	tex.unbind();
 }
 
-void Hell_drawFontEx(int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff, ...)
-{
-	string _tmpString = "";
-	void _putc(dchar c)
-	{
-		scope tmp = [c];
-		_tmpString ~= toUTF8(tmp);
-	}
-	doFormat(&_putc, _arguments, _argptr);
-	Hell_drawFont(_tmpString, x, y, zoom, r, g, b, a);
-}
-
 /**
  * αブレンド定数
  */
