Description: port to D language version 2
  With this patch the code is accapted by gdc-4.6 0.29.1-4.6.4-3 without
  triggering deprecated feature warnings/errors.
Author: Peter De Wachter <pdewacht@gmail.com>

--- a/import/hell2.d
+++ b/import/hell2.d
@@ -1,15 +1,16 @@
-module util.hell2;
+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.ctype;
+private import std.ascii;
 private import std.math;
-private import std.math2;
-private import std.c.stdio;
 private import std.format;
 private import std.utf;
 private import std.random;
+private import std.algorithm;
 private import SDL;
 private import SDL_mixer;
 private import opengl;
@@ -21,9 +22,9 @@
 static int g_videoBpp;
 static int g_videoFlags;
 static SDL_Surface* g_screen;
-static Texture [char[]] g_poolTexture;
+static Texture [string] g_poolTexture;
 static Texture g_fontTexture;
-static Mix_Chunk* [char[]] g_poolChunk;
+static Mix_Chunk* [string] g_poolChunk;
 static Mix_Music* g_music = null;
 static SDL_Surface* [int] g_poolFont;
 static bool g_quit = false;
@@ -32,7 +33,7 @@
 static ubyte g_pressMouseButton = 0;
 static bool[SDLK_LAST] g_pressKeyButtonPrev;
 static bool[SDLK_LAST] g_pressKeyButton;
-static const char[] g_logname = "run.log";
+static const string g_logname = "run.log";
 // OpenGL
 //static GLUquadricObj* g_quadricObj; // ２次曲面オブジェクト
 
@@ -68,7 +69,7 @@
 static bool[] g_joyButton;
 static SDL_Joystick* g_joy;
 static int g_joyButtonNum;
-static char[] FONT_PATH = "/usr/share/games/tatan/font/font.bmp";
+static string FONT_PATH = "/usr/share/games/tatan/font/font.bmp";
 
 static int fps_cnt;
 static int fps_view;
@@ -141,7 +142,7 @@
 	Hell_loadFont();
 	foreach(key; g_poolTexture.keys)
 	{
-		char[] path = g_poolTexture[key].getPath();
+		string path = g_poolTexture[key].getPath();
 		int mask[]  = g_poolTexture[key].getMaskInfo();
 		Hell_loadTexture(key, path, [mask[0], mask[1], mask[2]]);
 	}
@@ -152,7 +153,7 @@
  */
 void _saveBmp()
 {
-	auto line = g_width*3; // スキャンライン
+	scope line = g_width*3; // スキャンライン
 	// メモリ確保
 	scope pixels = new GLubyte[g_width*line];
 	// データ格納のサイズを設定
@@ -165,17 +166,19 @@
 	{
 		for(int i = 0; i < line; i++)
 		{
-			auto ptr1 = line*j + i;
-			auto ptr2 = line*(g_height-1-j) + i;
-			auto tmp  = pixels[ptr1];
+			scope ptr1 = line*j + i;
+			scope ptr2 = line*(g_height-1-j) + i;
+			scope tmp  = pixels[ptr1];
 			pixels[ptr1] = pixels[ptr2];
 			pixels[ptr2] = tmp;
 		}
 	}
-	if(auto surface = SDL_CreateRGBSurfaceFrom(
+	
+	scope surface = SDL_CreateRGBSurfaceFrom(
 		pixels.ptr,
 		g_width, g_height, 24, line,
-		0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000))
+		0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000);
+	if (surface)
 	{
 		SDL_SaveBMP(surface, "hellshot.bmp");
 		SDL_FreeSurface(surface);
@@ -185,7 +188,7 @@
 /**
  * SDL初期化
  */
-void Hell_init(char[] caption, int width=640, int height=480, bool fullscreen=false)
+void Hell_init(string caption, int width=640, int height=480, bool fullscreen=false)
 {
 	if(g_init) return;
 	g_width      = width;
@@ -222,7 +225,7 @@
 //	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: " ~ toString(SDL_GetError()));
+		throw new Error("Hell_init: " ~ to!string(SDL_GetError()));
 	}
 	
 	// ログ初期化
@@ -233,7 +236,7 @@
 		g_joy = SDL_JoystickOpen(0);
 		if(!g_joy)
 		{
-			throw new Error(toString(SDL_GetError()));
+			throw new Error(to!string(SDL_GetError()));
 		}
 		g_joyButtonNum = SDL_JoystickNumButtons(g_joy);
 		g_joyButtonPrev = new bool[g_joyButtonNum];
@@ -284,10 +287,10 @@
  */
 void Hell_setCaption(...)
 {
-	char[] _caption = "";
+	string _caption = "";
 	void _putc(dchar c)
 	{
-		auto tmp = [c];
+		scope tmp = [c];
 		_caption ~= toUTF8(tmp);
 	}
 	doFormat(&_putc, _arguments, _argptr);
@@ -303,7 +306,7 @@
 	void _putc(dchar c)
 	{
 		fputc(c, stdout);
-		auto tmp = [c];
+		scope tmp = [c];
 		append(g_logname, toUTF8(tmp));
 	}
 	doFormat(&_putc, _arguments, _argptr);
@@ -526,7 +529,7 @@
  * @param key  キー
  * @param path サウンドファイルのパス
  */
-void Hell_loadWAV(char[] key, char[] path)
+void Hell_loadWAV(string key, string path)
 {
 	if(key in g_poolChunk)
 	{
@@ -543,7 +546,7 @@
  * @param loops   ループ回数（-1で無限ループ）
  * @param channel チャンネル番号(-1であいているチャンネルを自動で使う)
  */
-void Hell_playWAV(char[] key, int loops=0, int channel=-1)
+void Hell_playWAV(string key, int loops=0, int channel=-1)
 {
 	if(!(key in g_poolChunk)) { throw new Error("Hell_playWAV: Has not exist key: " ~ key); }
 	Mix_PlayChannel(channel, g_poolChunk[key], loops);
@@ -562,7 +565,7 @@
  * SEを破棄
  * @param key   キー（nullで全て破棄）
  */
-void Hell_disposeWAV(char[] key=null)
+void Hell_disposeWAV(string key=null)
 {
 	if(key is null)
 	{
@@ -585,30 +588,30 @@
  * @param loops ループ回数（-1で無限ループ）
  * @param ms    フェードイン時間（ms）
  */
-void Hell_playBgm(char[] path, int loops=-1, int ms=0)
+void Hell_playBgm(string path, int loops=-1, int ms=0)
 {
 	if(g_music)
 	{
 		Mix_HaltMusic();
 		Mix_FreeMusic(g_music);
 	}
-	g_music = Mix_LoadMUS(cast(char*)(path ~ "\0"));
+	g_music = Mix_LoadMUS(cast(const(char)* )(path ~ "\0"));
 	if(!g_music)
 	{
-		throw new Error("Hell_playBgm: " ~ toString(SDL_GetError()));
+		throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError()));
 	}
 	if(ms <= 0)
 	{
 		if(Mix_PlayMusic(g_music, loops) != 0)
 		{
-			throw new Error("Hell_playBgm: " ~ toString(SDL_GetError()));
+			throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError()));
 		}
 	}
 	else
 	{
 		if(Mix_FadeInMusic(g_music, loops, ms) != 0)
 		{
-			throw new Error("Hell_playBgm: " ~ toString(SDL_GetError()));
+			throw new Error("Hell_playBgm: " ~ to!string(SDL_GetError()));
 		}
 	}
 }
@@ -830,7 +833,7 @@
  * @param b   マスク色(青）
  */
 void Hell_drawTexture(
-	char[] key,
+	string key,
 	float x, float y,
 	int ox=0, int oy=0, int ow=0, int oh=0,
 	float dx=1.0f, float dy=1.0f,
@@ -879,7 +882,7 @@
 /**
  * 中心座標を指定して描画
  */
-void Hell_drawTextureEx(char[] key, float cx, float cy,  int ox=0, int oy=0, int ow=0, int oh=0, float dx=1.0f, float dy=1.0f, float rot=0, ubyte r=255, ubyte g=255, ubyte b=255)
+void Hell_drawTextureEx(string key, float cx, float cy,  int ox=0, int oy=0, int ow=0, int oh=0, float dx=1.0f, float dy=1.0f, float rot=0, ubyte r=255, ubyte g=255, ubyte b=255)
 {
 	if(!(key in g_poolTexture)) { throw new Error("Hell_drawTexture: Has not exist key: " ~ key); }
 	Texture tex = g_poolTexture[key];
@@ -904,12 +907,12 @@
  * @param b     B成分
  * @param a     A成分
  */
-void Hell_drawFont(char[] msg, int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff)
+void Hell_drawFont(string msg, int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff)
 {
 	const int WIDTH  = 32; // フォントの幅
 	const int HEIGHT = 48; // フォントの高さ
 	const int COLUMN = 16; // フォントテクスチャの一行の文字数
-	char decoder[]   = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.()[]#$%&'\"!?^+-*/=;:";
+	string decoder   = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.()[]#$%&'\"!?^+-*/=;:";
 	Texture tex = g_fontTexture;
 	tex.bind();
 	glColor4ub(r, g, b, a);
@@ -920,9 +923,9 @@
 	float h = HEIGHT * zoom; // 実際の高さ
 	foreach(c; msg)
 	{
-		if(!isascii(c)) continue;    // ascii文字じゃないです
-		int idx = find(decoder, c); // 文字のインデックスを取得
-		if(c == ' ' | idx < 0)
+		if(!isASCII(c)) continue;    // ascii文字じゃないです
+		ptrdiff_t idx = countUntil(decoder, c); // 文字のインデックスを取得
+		if((c == ' ') | (idx < 0))
 		{
 			x += cast(int)(WIDTH * zoom); // スペース
 			continue;
@@ -951,10 +954,10 @@
 
 void Hell_drawFontEx(int x, int y, float zoom=1.0f, ubyte r=0xff, ubyte g=0xff, ubyte b=0xff, ubyte a=0xff, ...)
 {
-	char[] _tmpString = "";
+	string _tmpString = "";
 	void _putc(dchar c)
 	{
-		auto tmp = [c];
+		scope tmp = [c];
 		_tmpString ~= toUTF8(tmp);
 	}
 	doFormat(&_putc, _arguments, _argptr);
@@ -1019,7 +1022,7 @@
 		x = 10;
 		y = g_height - 48; // フォントの高さ
 	}
-	Hell_drawFont("FPS:" ~ toString(Hell_getFPS()), x, y);
+	Hell_drawFont("FPS:" ~ to!string(Hell_getFPS()), x, y);
 }
 
 
@@ -1029,7 +1032,7 @@
  * @param filepath ファイルパス
  * @param mask     抜き色（mask[0]に「-1」で抜き色なし。「-2」で座標指定）
  */
-void Hell_loadTexture(char[] key, char[] filepath, int[3] mask=[-1, 0, 0])
+void Hell_loadTexture(string key, string filepath, int[3] mask=[-1, 0, 0])
 {
 	//if(key in g_poolTexture) { throw new Error("Hell_loadTexture: Has exist key: " ~ key); }
 	if(key in g_poolTexture)
@@ -1037,7 +1040,6 @@
 		// 同じキーがある場合、そのテクスチャを破棄
 		Hell_disposeTexture(key);
 	}
-	if(mask is null) { throw new Error("Hell_loadTexture: PARAMETER 'mask' is null"); }
 	if(mask[0] >= 0)
 	{
 		// 抜き色指定
@@ -1063,7 +1065,7 @@
  * テクスチャの破棄
  * @param key キー（Hell_loadTextureで指定したもの）「null」で全て破棄
  */
-public void Hell_disposeTexture(char[] key=null)
+public void Hell_disposeTexture(string key=null)
 {
 	if(key is null)
 	{
@@ -1104,7 +1106,7 @@
 	/**
 	 * パス
 	 */
-	char[] _path;
+	string _path;
 	/**
 	 * マスク情報
 	 */
@@ -1116,7 +1118,7 @@
 	 * @param filename  ファイルパス
 	 * @param maskColor 抜き色
 	 */
-	this(char[] filename)
+	this(string filename)
 	{
 		_maskInfo = [-1, 0, 0];
 		SDL_Surface* s = loadBMP(filename);
@@ -1127,7 +1129,7 @@
 	 * @param filename  ファイルパス
 	 * @param maskColor 抜き色
 	 */
-	this(char[] filename, int r, int g, int b)
+	this(string filename, int r, int g, int b)
 	{
 		_maskInfo = [r, g, b];
 		SDL_Surface* s = loadBMP(filename);
@@ -1140,7 +1142,7 @@
 	 * @param filename  ファイルパス
 	 * @param maskColor 抜き色
 	 */
-	this(char[] filename, int x, int y)
+	this(string filename, int x, int y)
 	{
 		_maskInfo = [-2, x, y];
 		SDL_Surface* s = loadBMP(filename);
@@ -1155,7 +1157,7 @@
 		}
 		create(s);
 	}
-	char[] getPath()     { return _path;     }
+	string getPath()     { return _path;     }
 	int[] getMaskInfo()  { return _maskInfo; }
 	/**
 	 * 生成
@@ -1204,7 +1206,7 @@
 	/**
 	 * BMP読み込み
 	 */
-	SDL_Surface* loadBMP(char[] filename)
+	SDL_Surface* loadBMP(string filename)
 	{
 		// ファイルパス
 		_path = filename;
@@ -1254,11 +1256,11 @@
 float Hell_sin(float rad)            { return sin(rad);             }
 float Hell_cos(float rad)            { return cos(rad);             }
 float Hell_atan2(float y, float x)   { return atan2(y, x);          }
-float Hell_sinEx(float deg)          { return sin(deg2rad(deg));    }
-float Hell_cosEx(float deg)          { return cos(deg2rad(deg));    }
-float Hell_atan2Ex(float y, float x) { return rad2deg(atan2(y, x)); }
-float Hell_deg2rad(float deg)        { return deg2rad(deg);         }
-float Hell_rad2deg(float rad)        { return rad2deg(rad);         }
+float Hell_sinEx(float deg)          { return sin(deg/180*PI);      }
+float Hell_cosEx(float deg)          { return cos(deg/180*PI);      }
+float Hell_atan2Ex(float y, float x) { return atan2(y, x)/PI*180;   }
+float Hell_deg2rad(float deg)        { return deg/180*PI;           }
+float Hell_rad2deg(float rad)        { return rad/PI*180;           }
 // 乱数
 /**
  * 乱数の初期化
@@ -1269,18 +1271,18 @@
  * @param seed  種
  * @param index 次の乱数インデックスへの増分
  */
-void Hell_randSeed(uint seed, uint index)
-{
-	rand_seed(seed, index);
-}
+//void Hell_randSeed(uint seed, uint index)
+//{
+//	rand_seed(seed, index);
+//}
 /**
  * begin <= x < endの範囲で乱数を生成
  * @param begin 開始値
  * @param end   終了値
  */
-int Hell_randInt(int begin, int end)
-{
-	auto range = end - begin;
-	if(range < 1) return -1;
-	return begin + rand()%range;
-}
+//int Hell_randInt(int begin, int end)
+//{
+//	scope range = end - begin;
+//	if(range < 1) return -1;
+//	return begin + rand()%range;
+//}
--- a/src/br/background.d
+++ b/src/br/background.d
@@ -3,6 +3,7 @@
 private import opengl;
 private import std.math;
 private import std.string;
+private import std.conv;
 private import util.vector;
 private import util.parts;
 private import br.screen;
@@ -50,7 +51,7 @@
 		G=177.0f/255.0f;
 		B=205.0f/255.0f;
 	}
-	public void set(){
+	public override void set(){
 		for(float z = -400;-1200<z;z-=200.0f){
 			for(float y=-200;y<340;y+=100){
 				for(float x = -200;x<=200;x += 100){//114){
@@ -62,7 +63,7 @@
 		}
 	}
 	
-	public void run(){
+	public override void run(){
 		if((scnt) >= divsp(100)){
 			for(float z = -400;-1200<z;z-=200.0f){
 				for(float x = -200;x<=200;x += 100){//114){
@@ -92,7 +93,7 @@
 		G=177.0f/255.0f;
 		B=205.0f/255.0f;
 	}
-	public void set(){
+	public override void set(){
 		for(float z = -400;-1200<z;z-=200.0f){
 			for(float y=-200;y<340;y+=100){
 				for(float x = -200;x<=200;x += 100){//114){
@@ -104,7 +105,7 @@
 		}
 	}
 	
-	public void run(){
+	public override void run(){
 		if((scnt) >= divsp(33)){
 			for(float z = -400;-1200<z;z-=200.0f){
 				for(float x = -200;x<=200;x += 100){//114){
@@ -137,7 +138,7 @@
 		G=177.0f/255.0f;
 		B=205.0f/255.0f;
 	}
-	public void set(){}
+	public override void set(){}
 	public void start(){
 		Parts p = new Pattern4(new Vector3(0,0,-800));
 		(cast(Pattern)p).border = false;
@@ -150,7 +151,7 @@
 			num = cast(int)fmax(1,cos(phi*PI/180.0) * 24.0);
 			for(theta=0.0;theta<360;theta+=(360.0/num)){
 				p1 = new Pattern3();(cast(Pattern)p1).border = false;
-				p.addChild(p1 ,std.string.toString(phi)~std.string.toString(theta),Pattern3.RADIUS ,Parts.ENGAGED);
+				p.addChild(p1 ,to!string(phi)~to!string(theta),Pattern3.RADIUS ,Parts.ENGAGED);
 				p1.linkZ = theta;
 				p1.linkY = phi;
 			}
@@ -158,7 +159,7 @@
 	}
 	
 	
-	public void run(){
+	public override void run(){
 		super.run();
 		if(cnt < divsp(120)){
 			
@@ -183,4 +184,4 @@
 	
 	
 	
-}
\ No newline at end of file
+}
--- a/src/br/boot.d
+++ b/src/br/boot.d
@@ -31,9 +31,9 @@
 	_moduleCtor();
 	result = user_start();
 	SDL_Quit();
-	}catch (Object o)
+	}catch (Throwable o)
 	{
-	MessageBoxA(null, cast(char *)o.toString(), "Error",
+	MessageBoxA(null, cast(const(char)* )o.toString(), "Error",
 			MB_OK | MB_ICONEXCLAMATION);
 	result = 0; 	// failed
 	}
@@ -42,21 +42,20 @@
 }
 } else {
   // Boot as the general executable.
-  public int main(char[][] args) {
+  public int main(string[] args) {
     return user_start();
   }
 }
 
 int user_start(){
-	double d;
-
+/*
 	version (X86) {
     short cw;
     asm { fnstcw cw; }
     cw &= ~1;
     asm { fldcw cw; }
   }
-
+*/
 	key = new Key();
 	mouse = new Mouse();
 	mainloop = new Mainloop(key ,mouse);
--- a/src/br/boss.d
+++ b/src/br/boss.d
@@ -16,22 +16,22 @@
 private import br.particleImpl;
 
 public class Boss:Enemy{
-	char[] state;
+	string state;
 	int sCnt;
 	public this(int hp,Vector3 pos){
 		super(hp ,pos);
 		border = false;
 		changeState("start");
 	}
-	public void changeState(char[] state){
-		this.state = state.dup;
+	public void changeState(string state){
+		this.state = state;
 		sCnt = 0;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		sCnt ++;
 	}
-	public void destroyImpl(){
+	public override void destroyImpl(){
 //		super.destroy();
 		makeParticle(shape, size ,WIRE | POLYGON ,rpos ,new Vector3() ,rpose ,R ,G ,B ,R/2.0,G/2.0,B/2.0,alpha ,5.0f);
 		makeParticle(shape, size ,WIRE | POLYGON ,rpos ,new Vector3() ,rpose ,R ,G ,B ,R/2.0,G/2.0,B/2.0,alpha ,10.0f);
@@ -104,7 +104,7 @@
 		num = 0;
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		switch(state){
@@ -161,7 +161,7 @@
 				changeState("b");
 				/*
 				int next = rand.nextInt(3);
-				switch(next){
+				switch(next){ default: break;
 					case 0:
 					changeState("b");
 					break;
@@ -428,7 +428,7 @@
 		}
 		poseX ++;
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		switch(type){
 			case "a":
 			float dx = rand.nextFloat(1.0f);
@@ -463,7 +463,7 @@
 			default:break;
 		}
 	}	
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		Sound_PlaySe(se_kind.BOMB);
 	}
@@ -543,7 +543,7 @@
 		right = true;
 	
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		switch(state){
@@ -692,7 +692,7 @@
 //		poseZ += 1;
 //		childHash["larm4"].linkY -= 1.0f;
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		Sound_PlaySe(se_kind.BOMB);
 	}
@@ -747,7 +747,7 @@
 		p2.addChild(p3, "larm3", 40 ,ENGAGED);
 		*/
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		collisionRange = size;
 		switch(state){
@@ -942,11 +942,11 @@
 			dam = 0;
 //		}
 	}
-	public void size(double s){
+	public override void size(double s){
 		super.size(s);
 		collisionRange = size *3.0f / 4.0f;
 	}
-	public double size(){
+	public override double size(){
 		return super.size();
 	}
 }
@@ -1017,7 +1017,7 @@
 		p2.addChild(p3, "larm3", 40 ,ENGAGED);
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		switch(state){
 			case "start":
@@ -1036,11 +1036,11 @@
 		super.reportCollision(kind ,p);
 		dam = 0;
 	}
-	public void size(double s){
+	public override void size(double s){
 		super.size(s);
 		collisionRange = size *3.0f / 4.0f;
 	}
-	public double size(){
+	public override double size(){
 		return super.size();
 	}
 }
--- a/src/br/bullet.d
+++ b/src/br/bullet.d
@@ -29,7 +29,7 @@
 //		hp = 3;
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		if((rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size ||
@@ -53,7 +53,7 @@
 		}
 		
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha);
 
@@ -70,7 +70,7 @@
 		collisionRange = size/2.0f;
 		poseZ = 180;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseX += mulsp(2f);
 		
@@ -91,7 +91,7 @@
 		collisionRange = 10.0f;
 		poseZ = atan2(vel.y,vel.x)*180.0/PI;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		pos += mulsp(vel);
 //		vel *= 1.02f;
@@ -116,7 +116,7 @@
 		collisionRange = 10.0f;
 		poseZ = atan2(vel.y,vel.x)*180.0/PI;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		pos += mulsp(vel);
 		vel += mulsp(acc);
@@ -147,7 +147,7 @@
 		
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(parent is null){
 			pos += mulsp(vel);
@@ -199,7 +199,7 @@
 		hit = false;
 		right = false;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(parent is null){
 			pos += mulsp(vel);
@@ -269,7 +269,7 @@
 		poseZ = atan2(vel.y,vel.x)*180.0/PI;
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		pos += mulsp(vel);
 		if(rpos.y>ship.rpos.y-20.0){
@@ -287,4 +287,4 @@
 	
 	
 	
-}
\ No newline at end of file
+}
--- a/src/br/enemy.d
+++ b/src/br/enemy.d
@@ -18,7 +18,7 @@
 private import br.sound;
 
 
-public Enemy makeEnemy(char[] type ,Vector3 pos ,Vector3 vel ,Object par){
+public Enemy makeEnemy(string type ,Vector3 pos ,Vector3 vel ,Object par){
 	Enemy e = null;
 	switch(type){
 		
@@ -71,7 +71,7 @@
 		dam = 0;
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if(border && (rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size ||
 			screen.GAME_RIGHT  < rpos.x-size || rpos.x+size < screen.GAME_LEFT ||
@@ -110,7 +110,7 @@
 		
 	}
 	
-	public void attack(char[] type){}
+	public void attack(string type){}
 	public void damage(float d){
 		double dd;
 		dd = 1.0;
@@ -127,7 +127,7 @@
 		
 		dam = fmin(3.0 ,dam+dd);
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		destroyImpl();
 		
@@ -146,11 +146,11 @@
 	public void setBossColor(){
 		R = 1.0;G =1.0;B = 1.0;alpha = 1.0;
 	}
-	public void size(double s){
+	public override void size(double s){
 		super.size(s);
 		collisionRange = size / 2.0f;
 	}
-	public double size(){
+	public override double size(){
 		return super.size();
 	}
 }
@@ -178,7 +178,7 @@
 		this.vc = vc;
 	}
 	
-	public void move(){
+	public override void move(){
 		
 		
 		
@@ -197,7 +197,7 @@
 			if(vanishCount < 0)destroy();
 		}
 	}
-	public void damage(float d){
+	public override void damage(float d){
 		if(vincible){
 			hp -= d;
 			if(hp <= 0)destroy();
@@ -205,7 +205,7 @@
 			(cast(Enemy)parent).damage(d);
 		}
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha);
 	}
@@ -219,7 +219,7 @@
 		pre = new Vector3();
 		rpos = new Vector3();
 	}
-	public void move(){
+	public override void move(){
 		pre = cast(Vector3)rpos.clone();
 		super.move();
 		if(rpos.dist(pre) > 10.0f){
@@ -232,7 +232,7 @@
 	public this(Shape shape ,double size ,float hp = -1 ,double R = 1.0,double G = 1.0 ,double B = 1.0,double alpha = -1.0){
 		super(shape,size,hp,R,G,B,alpha);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		switch(type){
 			case "a":
 			double rad = poseDirection();
@@ -251,7 +251,7 @@
 	public this(Shape shape ,double size ,float hp = -1 ,double R = 1.0,double G = 1.0 ,double B = 1.0,double alpha = -1.0){
 		super(shape,size,hp,R,G,B,alpha);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		switch(type){
 			case "laser":
 			Vector3 aim = new Vector3(0.0f ,-100.0f ,-800.0f)-rpos;
@@ -328,7 +328,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		/*
 		if(cnt  == 60){
@@ -348,7 +348,7 @@
 		
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 //		Vector3 v = vec3Normalize(ship.rpos -rpos) * 1.0f;
 //			new Bullet(rpos ,v);
 	}
@@ -368,7 +368,7 @@
 	protected static Shape setShape(){
 		return new SH_Sphere(6);
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseY += mulsp(1f);
 		poseX += mulsp(2f);
@@ -386,7 +386,7 @@
 		super(pos ,vel ,hp ,size);
 		shape = getShape();//Cube.getShape();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseX += mulsp(2f);
 	}
@@ -406,7 +406,7 @@
 		super(pos ,vel ,hp);
 		shape = getShape();//Cube.getShape();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		vel *= 1.0f + mulsp(0.02f);
 		poseX += mulsp(2f);
@@ -449,7 +449,7 @@
 		super(pos ,vel ,hp);
 		shape = getShape();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseZ += mulsp(1f);
 //		poseX += 1.0f;
@@ -465,7 +465,7 @@
 		super(pos ,vel ,hp);
 		shape = getShape();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseZ += mulsp(1f);
 		vel *= 1.0f + mulsp(0.02f);
@@ -479,7 +479,7 @@
 		super(pos ,vel ,hp ,size);
 		shape = getShape();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		poseZ += mulsp(1f);
 		vel *= 1.0f - mulsp(0.02f);
@@ -490,7 +490,7 @@
 //		poseX += 1.0f;
 //		vel *= 1.0f + mulsp(0.02f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 
 		Vector3 vel = vec3Normalize(ship.rpos-rpos);
 		new AccBullet(rpos ,new Vector3(),vel*0.03);
@@ -515,7 +515,7 @@
 		this.aimBin = aim;
 		maxhp = hp;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 //		poseZ += mulsp(1f);
 //		vel *= 1.0f - mulsp(0.02f);
@@ -530,7 +530,7 @@
 //		poseX += 1.0f;
 //		vel *= 1.0f + mulsp(0.02f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		if(num > 0){
 			child = new MylmidonCell(new Vector3(),0.0,aimBin,num-1,hp,size);
 			if(!par){
@@ -567,7 +567,7 @@
 		setFlyColor();
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt  == divsp(60)){
 			attack("a");
@@ -579,7 +579,7 @@
 		poseX += mulsp(2f);
 //		poseY += 1f;
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 //		Vector3 v = vec3Normalize(ship.rpos -rpos) * 1.0f;
 //			new Bullet(rpos ,v);
 	}
@@ -607,16 +607,16 @@
 		
 		R = 1.0;G =1.0;B = 0.8;alpha = 1.0;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		pos += mulsp(vel);
 		
 		poseZ += mulsp(3f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		
 	}
-	public void destroy(){
+	public override void destroy(){
 		
 		new Star2(rpos ,new Vector3());
 		super.destroy();
@@ -646,7 +646,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		pos += mulsp(vel);
 		vel += mulsp(acc);
@@ -654,7 +654,7 @@
 		poseX += mulsp(2f);
 		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		
 	}
 	
@@ -681,7 +681,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt % divsp(60)==0)attack("a");
 		
@@ -691,7 +691,7 @@
 		poseX += mulsp(2f);
 		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 
 		Vector3 v = new Vector3(0.0f ,-3.0f ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);;
 		for(double y=0.0;y<100.0f;y+=30.0f){
@@ -735,7 +735,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		pos += mulsp(vel);
@@ -744,7 +744,7 @@
 		poseX += mulsp(2f);
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 /*
 		Vector3 v = new Vector3(0.0f ,-3.0f ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);;
 		for(double y=0.0;y<100.0f;y+=30.0f){
@@ -791,7 +791,7 @@
 		stop = 0;
 		stopped = false;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		if(stop<=0){
@@ -811,7 +811,7 @@
 //		poseY += mulsp(2f);
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		double rad = (-90.0 + (rand.nextFloat(20)-10.0))/180.0*PI;
 		Vector3 v = new Vector3(cos(rad) ,sin(rad) ,0.0f);//new Vector3(cos(rad)*6.0f ,-4.0f ,0.0f);//sin(rad)*6.0f,0.0f);;
 		
@@ -843,7 +843,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt == divsp(45))attack("a");
 		
@@ -853,7 +853,7 @@
 		poseX += mulsp(2f);
 		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 
 		Vector3 v = vec3Normalize(ship.rpos-rpos);
 		for(double y=0.0;y<50.0f;y+=20.0f){
@@ -885,7 +885,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt == divsp(60))attack("a");
 		
@@ -896,7 +896,7 @@
 		poseX += mulsp(2f);
 		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 
 		new AccBullet(rpos ,new Vector3(),vec3Normalize(ship.rpos - rpos) * 0.05f);
 		
@@ -932,7 +932,7 @@
 		
 		setFlyColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		/*
 		if(cnt  == divsp(120)){
@@ -947,11 +947,11 @@
 		poseZ += mulsp(2f);
 //		poseY += mulsp(1f);
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		attack("a");
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		new AccBullet(rpos ,new Vector3(0.0f ,0.0f ,0.0f),new Vector3(0.0f,-0.1f,0.0f));
 	}
 	
@@ -990,7 +990,7 @@
 		
 		setMiddleColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt  % divsp(20) == 0 && cnt < divsp(80)){
 			attack("a");
@@ -1001,7 +1001,7 @@
 		poseX += mulsp(2f);
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		Vector3 v;//vec3Normalize(ship.rpos -rpos) * 1.0f;
 		for(double rad=-PI/2.0-PI/12.0;rad<=-PI/2.0+PI/11.0;rad+=PI/12.0){
 			v = new Vector3(cos(rad) ,sin(rad) ,0.0f)*2.0f;
@@ -1044,7 +1044,7 @@
 		
 		setMiddleColor();
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt  % divsp(3) == 0){
 			attack("a");
@@ -1058,7 +1058,7 @@
 		
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		double rad;
 		if(rpos.x<0)rad = -cast(double)cnt /720.0 * PI;
 		else rad = PI + cast(double)cnt /720.0 * PI;
@@ -1101,7 +1101,7 @@
 		
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(rpos.y < 0)pos += mulsp(vel/2.0);
 		else pos += mulsp(vel*(rpos.y+screen.GAME_UP)/(screen.GAME_UP*2.0));
@@ -1110,7 +1110,7 @@
 		
 //		poseY += mulsp(1f);
 	}
-	public void attack(char[] type){
+	public override void attack(string type){
 		
 	}
 	
--- a/src/br/gamemanager.d
+++ b/src/br/gamemanager.d
@@ -185,7 +185,7 @@
 		setNextState("game");
 		
 	}
-	public void setNextState(char[] name){
+	public void setNextState(string name){
 		switch(name){
 				case "game":nextState = inGameState;break;
 				case "title":nextState = inTitleState;break;
@@ -262,7 +262,7 @@
 	public void move();
 	public void draw();
 //	public bool end();
-	public char[] name();
+	public string name();
 	
 }
 public class InGameState:GameState{
@@ -272,11 +272,11 @@
 
 	int endCount;
 	bool endFlag;
-	const char[] _name = "gameState";
+	const string _name = "gameState";
 	public this(){
 	}
 	
-	public void start(){
+	public override void start(){
 		
 		count = 0;
 		endCount = -1;
@@ -288,7 +288,7 @@
 		
 //		_end = false;
 	}
-	public void move(){
+	public override void move(){
 		if(!endFlag){
 			if(stage.complete){
 				stagenum = stagenum + 1;
@@ -345,7 +345,7 @@
 		
 		
 	}
-	public void draw(){
+	public override void draw(){
 			screen.setModelView();
 		screen.clear();
 		glLoadIdentity();
@@ -436,7 +436,7 @@
 		return _end;
 	}
 	*/
-	public char[] name(){
+	public override string name(){
 		return _name;
 	}
 }
@@ -446,11 +446,11 @@
 	int count;
 
 	SDL_Surface *back;
-	const char[] _name = "titleState";
+	const string _name = "titleState";
 	public this(){
 	}
 	
-	public void start(){
+	public override void start(){
 		
 		count = 0;
 		back = SDL_LoadBMP( "/usr/share/games/tatan/image/back.bmp" );
@@ -461,7 +461,7 @@
 		
 //		_end = false;
 	}
-	public void move(){
+	public override void move(){
 		/*
 		if(stage.complete){
 			stagenum = stagenum + 1;
@@ -500,7 +500,7 @@
 		
 		
 	}
-	public void draw(){
+	public override void draw(){
 		
 			
 		
@@ -586,7 +586,7 @@
 		return _end;
 	}
 	*/
-	public char[] name(){
+	public override string name(){
 		return _name;
 	}
 }
@@ -626,7 +626,7 @@
 	
 //	_gameSpeed = 1.0f;
 	/*
-	switch(rank){
+	switch(rank){ default: break;
 		case 0:_gameSpeed = 0.8;break;
 		case 1:_gameSpeed = 1.0;break;
 		case 2:_gameSpeed = 1.2;break;
@@ -695,4 +695,4 @@
 
 public int stagenum(){
 	return _stagenum;
-}
\ No newline at end of file
+}
--- a/src/br/mainloop.d
+++ b/src/br/mainloop.d
@@ -188,4 +188,4 @@
 	}
 }
 	
-	
\ No newline at end of file
+	
--- a/src/br/particleImpl.d
+++ b/src/br/particleImpl.d
@@ -11,7 +11,7 @@
 private import util.log;
 public class ParticleImpl:Particle{
 	
-	public void draw(){
+	public override void draw(){
 		
 //		glDisable(GL_BLEND);
 		//glLoadIdentity();
@@ -147,7 +147,7 @@
 			
 			average = average / cast(double)v.length;
 			
-			foreach(inout Vector3 vec;v){
+			foreach(ref Vector3 vec;v){
 				vec = vec - average;
 			}
 			
@@ -228,7 +228,7 @@
 	public this() {
 		maxParticle = 16;
 		particles.length = maxParticle;
-		foreach(inout ParticleImpl p;particles){
+		foreach(ref ParticleImpl p;particles){
 			p = new ParticleImpl();
 		}
 		//parts = new List!(Parts)();
@@ -238,7 +238,7 @@
   public this(int n) {
 		maxParticle = n;
 		particles.length = maxParticle;
-		foreach(inout ParticleImpl p;particles){
+		foreach(ref ParticleImpl p;particles){
 			p = new ParticleImpl();
 		}
 		//parts = new List!(Parts)();
@@ -291,7 +291,7 @@
 
 
   public void clear() {
-		foreach(inout ParticleImpl a;particles){
+		foreach(ref ParticleImpl a;particles){
 			if(a !is null && a.exists){
 				a.vanish();
 			}
@@ -299,4 +299,4 @@
    	//parts.length = 0;
     particleIdx = 0;
   }
-}
\ No newline at end of file
+}
--- a/src/br/screen.d
+++ b/src/br/screen.d
@@ -4,30 +4,30 @@
 private import SDL;
 private import hell2;
 private import std.string;
-private import std.c.stdlib;
+private import std.conv;
 private import br.mainloop;
 
 
 public class Screen{
 	public:
-	const int SCREEN_WIDTH = 640;
-	const int SCREEN_HEIGHT = 480;
-	const int SCREEN_BPP = 0;
-
-	const int GAME_LEFT = -200;
-	const int GAME_RIGHT = 200;
-	const int GAME_UP = 240;
-	const int GAME_DOWN = -240;
-	const int GAME_NEAR = -2;
-	const int GAME_FAR = -1600;
+	static const int SCREEN_WIDTH = 640;
+	static const int SCREEN_HEIGHT = 480;
+	static const int SCREEN_BPP = 0;
+
+	static const int GAME_LEFT = -200;
+	static const int GAME_RIGHT = 200;
+	static const int GAME_UP = 240;
+	static const int GAME_DOWN = -240;
+	static const int GAME_NEAR = -2;
+	static const int GAME_FAR = -1600;
 	
-	const GLfloat ambientCol[] = [1, 1, 1, 0.5]; 
+	static const GLfloat ambientCol[] = [1, 1, 1, 0.5]; 
 	
-	const GLfloat lightPos1[] = [ 0 , 0 , 100 , 0.0 ];
-	const GLfloat lightCol1[] = [ 1 , 1 , 1 , 1 ];
+	static const GLfloat lightPos1[] = [ 0 , 0 , 100 , 0.0 ];
+	static const GLfloat lightCol1[] = [ 1 , 1 , 1 , 1 ];
 	
-	const GLfloat lightPos2[] = [ 0 , 0 , 100 , 1.0 ];
-	const GLfloat lightCol2[] = [ 0 , 0 , 1 , 1 ];
+	static const GLfloat lightPos2[] = [ 0 , 0 , 100 , 1.0 ];
+	static const GLfloat lightCol2[] = [ 0 , 0 , 1 , 1 ];
 
 
 	static int g_videoFlags = SDL_SWSURFACE|SDL_OPENGL;
@@ -42,7 +42,7 @@
 		
 		if(SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) {
 			throw new Exception(
-        "Unable to init SDL video: " ~ std.string.toString(SDL_GetError()));
+        "Unable to init SDL video: " ~ to!string(SDL_GetError()));
 		}
 		//info = SDL_GetVideoInfo( );
 		
@@ -147,7 +147,7 @@
     if (error == GL_NO_ERROR)
       return;
     closeSDL();
-    throw new Exception("OpenGL error(" ~ std.string.toString(error) ~ ")");
+    throw new Exception("OpenGL error(" ~ to!string(error) ~ ")");
   }
 	public void closeSDL() {
     close();
@@ -188,7 +188,7 @@
 		Hell_loadTexture("back", "/usr/share/games/tatan/image/back.bmp");
 		Hell_loadFont();
 	}
-	public void saveBMP(char[] name){
+	public void saveBMP(string name){
 		SDL_SaveBMP(gScreenSurface, "screenshot.bmp");
 	}
-}
\ No newline at end of file
+}
--- a/src/br/ship.d
+++ b/src/br/ship.d
@@ -130,11 +130,11 @@
 		else screen.setClearColor(0.04 ,0.06 ,0.09 ,1.0);
 		*/
 	}
-	public void addChild(inout Parts child,char[] name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){
+	public override void addChild(ref Parts child,string name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){
 		super.addChild(child ,name ,dist ,childKind ,link ,pose);
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		double speed;
@@ -257,7 +257,7 @@
 			new Shot(rpos+vel * 70.0f ,vel * 30.0f ,deg);//deg);
 		}
 	}
-	public void draw(){
+	public override void draw(){
 		if((invincible > 0) && (cnt % 20 < 10))drawing = WIRE;
 		else drawing = WIRE | POLYGON;
 		super.draw();
@@ -278,7 +278,7 @@
 		
 	}
 */
-	public void reportCollision(int kind ,Parts p){
+	public override void reportCollision(int kind ,Parts p){
 		switch(kind){
 			case CollisionManager.kind.STAR:
 //			if(R <= 0.9f)R += 0.1f;
@@ -306,7 +306,7 @@
 		
 		
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		miss = true;
 		makeParticle(shape, size ,WIRE | POLYGON ,rpos ,new Vector3() ,rpose ,R ,G ,B ,wR,wG,wB,alpha);
@@ -349,4 +349,4 @@
 		
 		poseZ = rposeZ = 90.0;
 	}
-}
\ No newline at end of file
+}
--- a/src/br/sound.d
+++ b/src/br/sound.d
@@ -213,4 +213,4 @@
 public int Sound_PlayingMusic(){
 	if(Mix_PlayingMusic() == 0)_Sound_PlayingMusic = -1;
 	return _Sound_PlayingMusic;
-}
\ No newline at end of file
+}
--- a/src/br/stage.d
+++ b/src/br/stage.d
@@ -65,8 +65,8 @@
 			Sound_FadeOutMusic(1000);
 		}else Sound_FadeInMusic(music, 2000);
 	}
-	public void addEnemyData(int time ,char[] type ,float posx ,float posy ,float v ,double angle ,Object par = null ,bool target=false){
-		ObjectData e = new ObjectData(time ,type.dup ,new Vector3(posx ,posy ,-800)
+	public void addEnemyData(int time ,string type ,float posx ,float posy ,float v ,double angle ,Object par = null ,bool target=false){
+		ObjectData e = new ObjectData(time ,type ,new Vector3(posx ,posy ,-800)
 		 ,new Vector3(v*cos(angle*PI/180.0) ,v*sin(angle*PI/180.0) ,0.0f) ,par ,target);
 		if(enemyNum < enemyData.length)enemyData[enemyNum] = e;
 		else{
@@ -75,8 +75,8 @@
 		}
 		enemyNum ++;
 	}
-	public void addWallData(int time ,char[] type ,float posx ,float posy ,float v ,double angle = -90.0 ,Object par = null){
-		ObjectData w = new ObjectData(time ,type.dup ,new Vector3(posx ,posy ,-800)
+	public void addWallData(int time ,string type ,float posx ,float posy ,float v ,double angle = -90.0 ,Object par = null){
+		ObjectData w = new ObjectData(time ,type ,new Vector3(posx ,posy ,-800)
 		 ,new Vector3(v*cos(angle*PI/180.0) ,v*sin(angle*PI/180.0) ,0.0f) ,par);
 		if(wallNum < wallData.length)wallData[wallNum] = w;
 		else{
@@ -229,15 +229,15 @@
 }
 public class ObjectData{
 	public int time;
-	public char[] type;
+	public string type;
 	public Vector3 pos;
 	public Vector3 vel;
 	public Object par;
 	public bool target;
 	public bool made;
-	public this(int time ,char[] type ,Vector3 pos ,Vector3 vel ,Object par = null ,bool target = false){
+	public this(int time ,string type ,Vector3 pos ,Vector3 vel ,Object par = null ,bool target = false){
 		this.time = time;
-		this.type = type.dup;
+		this.type = type;
 		this.pos = cast(Vector3)pos.clone();
 		this.vel = cast(Vector3)vel.clone();
 		this.par =par;
@@ -262,10 +262,10 @@
 		bg = new Back1();
 		
 	}
-	void setSound(){
+	override void setSound(){
 		music = music_kind.MUSIC1;
 	}
-	void setEnemies(){
+	override void setEnemies(){
 	
 	
 //		addEnemyData(30 ,"laser" ,0 ,240 ,1.0 ,-90);
@@ -316,7 +316,7 @@
 
 	}
 	
-	void setWalls(){
+	override void setWalls(){
 		/*
 		for(int i=0;i<1200;i+=240){
 			addWallData(i ,"1" ,rand.nextFloat(Screen.GAME_RIGHT - Screen.GAME_LEFT) + Screen.GAME_LEFT ,240 ,3 );
@@ -324,7 +324,7 @@
 		*/
 	}
 	
-	void setStars(){
+	override void setStars(){
 		for(int i=0;i<300;i+=60){
 			addStarData(60 ,(i/60)%2);
 		}
@@ -353,10 +353,10 @@
 		bg = new Back2();
 		
 	}
-	void setSound(){
+	override void setSound(){
 		music = music_kind.MUSIC1;
 	}
-	void setEnemies(){
+	override void setEnemies(){
 		
 		
 		
@@ -476,7 +476,7 @@
 
 	}
 	
-	void setWalls(){
+	override void setWalls(){
 		addWallData(260,null,0,0,0);
 		makeCource(true ,100 ,160 ,3.0f ,1 ,2);
 		addWallData(30,null,0,0,0);
@@ -504,7 +504,7 @@
 		*/
 	}
 	
-	void setStars(){
+	override void setStars(){
 		for(int i=0;i<160;i+=60){
 			addStarData(60 ,(i/60)%2);
 		}
@@ -587,21 +587,21 @@
 		bg = new Back3();
 		
 	}
-	void setSound(){
+	override void setSound(){
 		music = music_kind.MUSIC2;
 	}
-	void setEnemies(){
+	override void setEnemies(){
 		
 		
 		addEnemyData(210 ,"boss3" ,0 ,160 ,0 ,0 ,null ,true);
 
 	}
 	
-	void setWalls(){
+	override void setWalls(){
 		
 	}
 	
-	void setStars(){
+	override void setStars(){
 	
 	}
 	
@@ -614,19 +614,19 @@
 		bg = new Back2();
 		
 	}
-	void setSound(){
+	override void setSound(){
 		music = -1;
 	}
-	void setEnemies(){
+	override void setEnemies(){
 		
 
 	}
 	
-	void setWalls(){
+	override void setWalls(){
 		
 	}
 	
-	void setStars(){
+	override void setStars(){
 	
 	}
 	
--- a/src/br/wall.d
+++ b/src/br/wall.d
@@ -8,7 +8,7 @@
 private import br.mainloop;
 private import br.gamemanager;
 
-public void makeWall(char[] type ,Vector3 pos ,Vector3 vel ,Object par = null){
+public void makeWall(string type ,Vector3 pos ,Vector3 vel ,Object par = null){
 	switch(type){
 		case "1" : new Wall1(pos ,vel);
 		
@@ -38,7 +38,7 @@
 //		hp = 3;
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if((rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size ||
 			screen.GAME_RIGHT  < rpos.x-size || rpos.x+size < screen.GAME_LEFT ||
@@ -58,7 +58,7 @@
 		}
 		
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha);
 
@@ -81,7 +81,7 @@
 		
 		poseZ = atan2(vel.y,vel.x)*180.0/PI;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		pos += mulsp(vel);
@@ -89,4 +89,4 @@
 		poseX += mulsp(2f);
 	}
 	
-}
\ No newline at end of file
+}
--- a/src/util/actor.d
+++ b/src/util/actor.d
@@ -1,3 +1,4 @@
+module util.actor;
 private import opengl;
 public abstract class Actor{
 	private bool _exists;
@@ -18,7 +19,7 @@
 	public:
 	Actor[] actor;
 	protected:
-  	int actorIdx = 0;
+  	ptrdiff_t actorIdx = 0;
 	const int maxActor;
 	public this() {
 		maxActor = 16;
@@ -74,7 +75,7 @@
   }
 /*
   public void allDestroy() {
-	foreach(inout Actor a;actor){
+	foreach(ref Actor a;actor){
 		if(a !is null && a.exists){
 			a.destroy();
 		}
@@ -84,7 +85,7 @@
   }
 */
   public void clear(){
-  	foreach(inout Actor a;actor){
+  	foreach(ref Actor a;actor){
 		if(a !is null && a.exists){
 			a.vanish();
 		}
@@ -93,4 +94,4 @@
     actorIdx = 0;
   }
   
-}
\ No newline at end of file
+}
--- a/src/util/animation.d
+++ b/src/util/animation.d
@@ -113,7 +113,7 @@
 
 
   public void clear() {
-		foreach(inout Animation a;animes){
+		foreach(ref Animation a;animes){
 			if(a !is null && a.exists){
 				a.vanish();
 			}
--- a/src/util/ascii.d
+++ b/src/util/ascii.d
@@ -29,15 +29,15 @@
 }
 private:
 const int[] bar_a = [0    ,2 ,3 ,4 ,5 ,6];
-const int[] bar_b = [  ,1    ,3 ,4 ,5 ,6];
+const int[] bar_b = [   1    ,3 ,4 ,5 ,6];
 const int[] bar_c = [0 ,1       ,4    ,6];
 const int[] bar_d = [      2 ,3 ,4 ,5 ,6];
 const int[] bar_e = [0 ,1 ,2 ,3 ,4    ,6];
 const int[] bar_f = [0 ,1    ,3 ,4      ];
 const int[] bar_g = [0 ,1 ,2 ,3    ,5 ,6];
 const int[] bar_h = [   1    ,3 ,4 ,5   ];
-const int[] bar_i = [     ,2       ,5   ];
-const int[] bar_j = [     ,2       ,5 ,6];
+const int[] bar_i = [      2       ,5   ];
+const int[] bar_j = [      2       ,5 ,6];
 const int[] bar_k = [   1    ,3 ,4    ,6];
 const int[] bar_l = [   1       ,4    ,6];
 const int[] bar_m = [0 ,1    ,3 ,4    ,6];
@@ -45,17 +45,17 @@
 const int[] bar_o = [0 ,1 ,2    ,4 ,5 ,6];
 const int[] bar_p = [0 ,1 ,2 ,3 ,4      ];
 const int[] bar_q = [0 ,1 ,2 ,3    ,5   ];
-const int[] bar_r = [        ,3 ,4      ];
+const int[] bar_r = [         3 ,4      ];
 const int[] bar_s = [0 ,1    ,3    ,5 ,6];
 const int[] bar_t = [0 ,1       ,4      ];
 const int[] bar_u = [   1 ,2    ,4 ,5 ,6];
-const int[] bar_v = [           ,4 ,5 ,6];
+const int[] bar_v = [            4 ,5 ,6];
 const int[] bar_w = [0    ,2 ,3    ,5 ,6];
 const int[] bar_x = [   1 ,2 ,3 ,4 ,5   ];
 const int[] bar_y = [   1 ,2 ,3    ,5 ,6];
 const int[] bar_z = [0    ,2 ,3 ,4    ,6];
 const int[] bar__ = [                  6];
-const int[] bar_exc = [  ,1             ,6];
+const int[] bar_exc = [   1             ,6];
 const int[] bar_0 = [0 ,1 ,2    ,4  ,5 ,6];
 const int[] bar_1 = [      2       ,5    ];
 const int[] bar_2 = [0    ,2 ,3 ,4    ,6];
@@ -69,10 +69,10 @@
 
 public void drawAlphabet(char c ,float x,float y ,float scale = 1.0){
 	bool[7] bar;
-	foreach(inout b;bar){
+	foreach(ref b;bar){
 		b = false;
 	}
-	int[] bars;
+	const(int)[] bars;
 	switch(c){
 		case 'a':case 'A':bars = bar_a;break;
 		case 'b':case 'B':bars = bar_b;break;
@@ -145,7 +145,7 @@
 	*/
 }
 
-public void drawString(char[] s ,float x ,float y ,float scale = 1.0){
+public void drawString(string s ,float x ,float y ,float scale = 1.0){
 	int dx = 0;
 	foreach(char c;s){
 		drawAlphabet(c ,x + dx ,y ,scale);
@@ -153,16 +153,16 @@
 	}
 }
 
-public void drawStringCenter(char[] s ,float y ,float scale = 1.0){
+public void drawStringCenter(string s ,float y ,float scale = 1.0){
 	int dx = 0;
-	int x =  (s.length - 1) * 30 / 2 * -1;
+	int x =  cast(int)(s.length - 1) * 30 / 2 * -1;
 	foreach(char c;s){
 		drawAlphabet(c ,x + dx ,y ,scale);
 		dx += scale * 30.0;
 	}
 }
 
-public void drawString(char[] s ,float x ,float y ,int start ,int end ,float scale = 1.0){
+public void drawString(string s ,float x ,float y ,int start ,int end ,float scale = 1.0){
 //	if(end < start || start >= s.length || end < 0)return;
 	int dx = 0;
 	for(int i=0;i<s.length;i++){
@@ -189,7 +189,7 @@
 
 public void drawNumber(int num,float x ,float y ,float scale = 1.0){
 	bool[7] bar;
-	foreach(inout b;bar){
+	foreach(ref b;bar){
 		b = false;
 	}
 	switch(num){
@@ -333,4 +333,4 @@
 		
 		glPopMatrix();
 	}
-}
\ No newline at end of file
+}
--- a/src/util/beam.d
+++ b/src/util/beam.d
@@ -45,16 +45,16 @@
 		
 		this.pos = new Vector3();
 		this.rpos = cast(Vector3)this.pos.clone();
-		foreach(inout p;locuspos){
+		foreach(ref p;locuspos){
 			p = cast(Vector3)rpos.clone();
 		}
-		foreach(inout a;locusaim){
+		foreach(ref a;locusaim){
 			a = aim;
 		}
 		rolling = true;
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if(!fixAim){
 			linkZ = deglimit(linkZ + dDeg);
@@ -120,23 +120,23 @@
 		this.linkZ = rposeZ;
 		this.taim = rposeZ;
 		
-		foreach(inout a;locusaim){
+		foreach(ref a;locusaim){
 			a = rposeZ;
 		}
 		
 		
-		foreach(inout p;locuspos){
+		foreach(ref p;locuspos){
 			p = parent.rpos; //+ new Vector3(dist * cos(linkZ) ,dist * sin(linkZ) ,0);
 		} 
 		
 		/*
-		foreach(inout a;locusaim){
+		foreach(ref a;locusaim){
 			a = linkZ;
 		}
 		*/
 	}
 	
-	public void draw(){
+	public override void draw(){
 		glPushMatrix();
 		super.draw();
 		glPopMatrix();
@@ -269,7 +269,7 @@
 		
 		glDisable(GL_BLEND);
 	}
-	public void reportCollision(int kind ,Parts p){}
+	public override void reportCollision(int kind ,Parts p){}
 		
 }
 
--- a/src/util/collision.d
+++ b/src/util/collision.d
@@ -108,10 +108,10 @@
 		}
 	}
 	public void clear(){
-		foreach(inout Laser p;laser){
+		foreach(ref Laser p;laser){
 			p = null;
 		}
-		foreach(inout Parts p;group){
+		foreach(ref Parts p;group){
 			p = null;
 		}
 		lidx = 0;
@@ -168,7 +168,7 @@
 	public void collisionDetect(int kind){
 		
 		if(laser is null || !laser.exists || !laser.drawn){
-			foreach(inout Parts p;group){
+			foreach(ref Parts p;group){
 				if (p !is null && p.exists){
 					p.laserState =p.NONE;
 				}
@@ -181,7 +181,7 @@
 		Vector el = l + aim * laser.length;
 		//Parts p;
 		//if(p is null || p.exists || p.drawn)return;
-		foreach(inout Parts p;group){
+		foreach(ref Parts p;group){
 	    if (p !is null && p.exists){
 				if(!p.inCollisionRange){
 					p.laserState =p.NONE;
@@ -215,7 +215,7 @@
 	}
 	public void clear(){
 		laser = null;
-		foreach(inout Parts p;group){
+		foreach(ref Parts p;group){
 			p = null;
 		}
 		idx = 0;
@@ -283,10 +283,10 @@
 		}
 	}
 	public void clear() {
-		foreach(inout Parts p;group1){
+		foreach(ref Parts p;group1){
 			p = null;
 		}
-		foreach(inout Parts p;group2){
+		foreach(ref Parts p;group2){
 			p = null;
 		}
     idx1 = idx2 = 0;
--- a/src/util/key.d
+++ b/src/util/key.d
@@ -1,6 +1,7 @@
 module util.key;
 private import SDL;
 private import std.string;
+private import std.conv;
 public class Key{
 	public:
   static enum Dir {
@@ -16,7 +17,7 @@
 	public this(){
 		if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) {
       throw new Exception(
-        "Unable to init SDL joystick: " ~ std.string.toString(SDL_GetError()));
+        "Unable to init SDL joystick: " ~ to!string(SDL_GetError()));
     }
     stick = SDL_JoystickOpen(0);
 	}
--- a/src/util/log.d
+++ b/src/util/log.d
@@ -1,11 +1,11 @@
 module util.log;
 private import std.string;
+private import std.conv;
 private import std.file;
 private import std.path;
 private import std.cstream;
-private import std.ctype;
-static const char[] g_logname = "run.log";
-void Log_write(char[] msg)
+static const string g_logname = "run.log";
+void Log_write(string msg)
 {
 	std.cstream.dout.writeLine(msg);
 	append(g_logname, msg ~ "\n");
@@ -13,10 +13,10 @@
 void Log_write(int msg)
 {
 	printf("%d\n", msg);
-	append(g_logname, std.string.toString(msg) ~ "\n");
+	append(g_logname, to!string(msg) ~ "\n");
 }
 void Log_write(Exception e)
 {
 	std.cstream.dout.writeLine(e.toString());
 	append(g_logname, e.toString() ~ "\n");
-}
\ No newline at end of file
+}
--- a/src/util/particle.d
+++ b/src/util/particle.d
@@ -110,7 +110,7 @@
 		cnt = 0;
 		_exists = true;
 	}
-	public void move(){
+	public override void move(){
 //		super.move();
 		cnt ++;
 		if(cnt > 3){
@@ -129,7 +129,7 @@
 		if(alpha < 0.1)vanish();
 		
 	}
-	public void draw(){
+	public override void draw(){
 		
 //		glDisable(GL_BLEND);
 		//glLoadIdentity();
@@ -233,10 +233,10 @@
 		
 //		drawn = true;
 	}
-	public void vanish(){
+	public override void vanish(){
 		_exists = false;
 	}
-	public bool exists(){
+	public override bool exists(){
 		return _exists;
 	}
 
@@ -258,7 +258,7 @@
 	public this() {
 		maxParticle = 16;
 		particles.length = maxParticle;
-		foreach(inout Particle p;particles){
+		foreach(ref Particle p;particles){
 			p = new Particle();
 		}
 		//parts = new List!(Parts)();
@@ -268,7 +268,7 @@
   public this(int n) {
 		maxParticle = n;
 		particles.length = maxParticle;
-		foreach(inout Particle p;particles){
+		foreach(ref Particle p;particles){
 			p = new Particle();
 		}
 		//parts = new List!(Parts)();
@@ -322,7 +322,7 @@
 
 
   public void clear() {
-		foreach(inout Particle a;particles){
+		foreach(ref Particle a;particles){
 			if(a !is null && a.exists){
 				a.vanish();
 			}
@@ -331,4 +331,4 @@
     particleIdx = 0;
   }
   
-}
\ No newline at end of file
+}
--- a/src/util/parts.d
+++ b/src/util/parts.d
@@ -36,8 +36,8 @@
 		Shape shape;
 		Parts parent;
 		Parts[] childs;
-		Parts[char[]] childHash;
-		Animation[char[]] animes;
+		Parts[string] childHash;
+		Animation[string] animes;
 		Matrix poseBase;
 		Matrix linkBase;
 		bool linkBased;
@@ -134,7 +134,7 @@
 		setPoseBase(poseBase);
 	}
 	*/
-	public bool addAnimation(Animation anime ,char[] name){
+	public bool addAnimation(Animation anime ,string name){
 		
 		//if(name in animes)return false;
 		animes[name] = anime;
@@ -142,7 +142,7 @@
 		
 		return true;
 	}
-	public void deleteAnimation(char[] name){
+	public void deleteAnimation(string name){
 		animes[name] = null;
 	}
 	public bool inAnimation(){
@@ -152,7 +152,7 @@
 		}
 		return inanime;
 	}
-	public bool inAnimation(char[] name){
+	public bool inAnimation(string name){
 		if(name in animes){
 			return animes[name].active;
 		}else return false;
@@ -185,7 +185,7 @@
 			}
 		}
 	}
-	public void addChild(inout Parts child,char[] name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){
+	public void addChild(ref Parts child,string name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){
 		childs.length = childs.length + 1;
 		childs[childs.length - 1] = child;
 		addChildHash(child ,name);
@@ -215,7 +215,7 @@
 	}
 	*/
 	
-	public void addChildHash(Parts child ,char[] name){
+	public void addChildHash(Parts child ,string name){
 		childHash[name] = child;
 		if(parent !is null)parent.addChildHash(child ,name);
 	}
@@ -226,8 +226,8 @@
 	*/
 	public override void move(){
 		cnt ++;
-		char[][] names = animes.keys;
-		foreach(char[] name;names){
+		string[] names = animes.keys;
+		foreach(string name;names){
 			Animation an = animes[name];
 
 			if (an !is null && an.exists && an.active){
@@ -758,7 +758,7 @@
 //		destroyImpl();
 	}
 //	public void destroyImpl(){}
-	public void vanish(){
+	public override void vanish(){
 		super.vanish();
 		if(parent !is null){
 			Parts c;
@@ -894,7 +894,7 @@
   }
 +/
   public void allDestroy() {
-		foreach(inout Actor p;actor){
+		foreach(ref Actor p;actor){
 			if(p !is null && p.exists){
 				(cast(Parts)p).destroy();
 			}
@@ -904,7 +904,7 @@
   }
   /*
   public void clear(){
-  	foreach(inout Parts p;parts){
+  	foreach(ref Parts p;parts){
 			if(p !is null && p.exists){
 				p.vanish();
 			}
@@ -914,7 +914,7 @@
   }
   */
    public void allParentsDestroy(){
-  	foreach(inout Actor p;actor){
+  	foreach(ref Actor p;actor){
 		if(p !is null && p.exists && (cast(Parts)p).parent is null){
 			(cast(Parts)p).destroy();
 		}
@@ -972,4 +972,4 @@
 	}
 	*/
 }
-+/
\ No newline at end of file
++/
--- a/src/util/rand.d
+++ b/src/util/rand.d
@@ -6,7 +6,7 @@
 module util.rand;
 
 private import std.stream;
-private import std.date;
+private import std.datetime;
 
 /**
  * Random number generator.
@@ -14,7 +14,7 @@
 public class Rand {
   
   public this() {
-    d_time timer = getUTCtime();
+    long timer = Clock.currStdTime();
     init_genrand(cast(uint)timer);
   }
 
@@ -55,7 +55,7 @@
      Matthe Bellew, and Isaku Wada
    Andrew C. Edwards  v0.1  30 September 2003  edwardsac@ieee.org
 
-   Before using, initialize the state by using init_genrand(seed) 
+   Before using, initialize the state by using init_genrand() 
    or init_by_array(init_key, key_length).
 
    Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
@@ -122,7 +122,7 @@
 {
     state[0]= cast(uint)(s & 0xffffffffUL);
     for (int j=1; j<N; j++) {
-        state[j] = cast(uint)(1812433253UL * (state[j-1] ^ (state[j-1] >> 30)) + j); 
+        state[j] = cast(uint)(1812433253U * (state[j-1] ^ (state[j-1] >> 30)) + j); 
         /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
         /* In the previous versions, MSBs of the seed affect   */
         /* only MSBs of the array state[].                        */
@@ -140,11 +140,11 @@
 void init_by_array(uint init_key[], uint key_length)
 {
     int i, j, k;
-    init_genrand(19650218UL);
+    init_genrand(cast(uint)19650218UL);
     i=1; j=0;
     k = (N>key_length ? N : key_length);
     for (; k; k--) {
-        state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL))
+        state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525U))
           + init_key[j] + j; /* non linear */
         state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
         i++; j++;
@@ -152,7 +152,7 @@
         if (j>=key_length) j=0;
     }
     for (k=N-1; k; k--) {
-        state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL))
+        state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941U))
           - i; /* non linear */
         state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
         i++;
@@ -169,7 +169,7 @@
 
     /* if init_genrand() has not been called, */
     /* a default initial seed is used         */
-    if (initf==0) init_genrand(5489UL);
+    if (initf==0) init_genrand(cast(uint)5489UL);
 
     left = N;
     next = cast(uint*)state;
--- a/src/util/record.d
+++ b/src/util/record.d
@@ -10,48 +10,48 @@
 	public this(int stage ,int rank){
 		lapTime.length = stage;
 		totalTime.length = stage;
-		foreach(inout int[] lap;lapTime){
+		foreach(ref int[] lap;lapTime){
 			lap.length = rank;
 			
 		}
-		foreach(inout int[] total;totalTime){
+		foreach(ref int[] total;totalTime){
 			total.length = rank;
 			
 		}
 		start();
 	}
 	public void start(){
-		foreach(inout int[] lap;lapTime){
-			foreach(inout int l;lap){
+		foreach(ref int[] lap;lapTime){
+			foreach(ref int l;lap){
 				l = 359999;
 			}
 		}
-		foreach(inout int[] total;totalTime){
-			foreach(inout int t;total){
+		foreach(ref int[] total;totalTime){
+			foreach(ref int t;total){
 				t = 359999;
 			}
 		}
 	}
 	public void load(File fd){
-		foreach(inout int[] lap;lapTime){
-			foreach(inout int l;lap){
+		foreach(ref int[] lap;lapTime){
+			foreach(ref int l;lap){
 				fd.read(l);
 			}
 		}
-		foreach(inout int[] total;totalTime){
-			foreach(inout int t;total){
+		foreach(ref int[] total;totalTime){
+			foreach(ref int t;total){
 				fd.read(t);
 			}
 		}
 	}
 	public void save(File fd){
-		foreach(inout int[] lap;lapTime){
-			foreach(inout int l;lap){
+		foreach(ref int[] lap;lapTime){
+			foreach(ref int l;lap){
 				fd.write(l);
 			}
 		}
-		foreach(inout int[] total;totalTime){
-			foreach(inout int t;total){
+		foreach(ref int[] total;totalTime){
+			foreach(ref int t;total){
 				fd.write(t);
 			}
 		}
@@ -62,7 +62,7 @@
 		for(int i=0;i<lapTime[stage].length;i++){
 			if(lap < lapTime[stage][i]){
 				rank = i+1;
-				for(int j=lapTime[stage].length-1;i<j;j--){
+				for(ptrdiff_t j=lapTime[stage].length-1;i<j;j--){
 					lapTime[stage][j] = lapTime[stage][j-1];
 				}
 				lapTime[stage][i] = lap;
@@ -78,7 +78,7 @@
 		for(int i=0;i<totalTime[stage].length;i++){
 			if(total < totalTime[stage][i]){
 				rank = i+1;
-				for(int j=totalTime[stage].length-1;i<j;j--){
+				for(ptrdiff_t j=totalTime[stage].length-1;i<j;j--){
 					totalTime[stage][j] = totalTime[stage][j-1];
 				}
 				totalTime[stage][i] = total;
--- a/src/util/shape.d
+++ b/src/util/shape.d
@@ -80,16 +80,16 @@
 		//this.fixedV = v.dup;
 		this.fixedV.length = v.length;
 		this.v.length = fixedV.length;
-		for(int i = fixedV.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = fixedV.length - 1;0 <= i;i --){
 			this.fixedV[i] = new Vector3(v[i]);
 			this.v[i] = new Vector3(fixedV[i]);
 		}
 		this.wires.length = wires.length;
-		for(int i = wires.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = wires.length - 1;0 <= i;i --){
 			this.wires[i] = wires[i].dup;
 		}
 		this.polygons.length = polygons.length;
-		for(int i = polygons.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = polygons.length - 1;0 <= i;i --){
 			for(int j = polygons[i].v.length - 1;0 <= j;j --){
 				this.polygons[i].v[j] = polygons[i].v[j];
 			}
@@ -114,7 +114,7 @@
 		for(int i=0;i<s.wires.length;i++){
 			int[] w;
 			for(int j=0;j<s.wires[i].length;j++){
-				w ~= s.wires[i][j] + v.length;
+				w ~= cast(int)(s.wires[i][j] + v.length);
 			}
 			wires1 ~= w;
 		}
@@ -122,9 +122,9 @@
 		
 		for(int i=0;i<s.polygons.length;i++){
 			polygon p;
-			p.v[0] = s.polygons[i].v[0] + v.length;
-			p.v[1] = s.polygons[i].v[1] + v.length;
-			p.v[2] = s.polygons[i].v[2] + v.length;
+			p.v[0] = cast(int)(s.polygons[i].v[0] + v.length);
+			p.v[1] = cast(int)(s.polygons[i].v[1] + v.length);
+			p.v[2] = cast(int)(s.polygons[i].v[2] + v.length);
 			p.normal = new Vector3(s.polygons[i].normal);
 			
 			polygons1 ~= p;
@@ -139,24 +139,24 @@
     return shape;
   }
 	public void resetVertex(){
-		for(int i = v.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = v.length - 1;0 <= i;i --){
 			v[i] = new Vector3(fixedV[i]);
 		}
 	}
 	public Shape reverseX(){
-		foreach(inout vec;v){
+		foreach(ref vec;v){
 			vec.x = -vec.x;
 		}
 		return this;
 	}
 	public Shape reverseY(){
-		foreach(inout vec;v){
+		foreach(ref vec;v){
 			vec.y = -vec.y;
 		}
 		return this;
 	}
 	public Shape reverseZ(){
-		foreach(inout vec;v){
+		foreach(ref vec;v){
 			vec.z = -vec.z;
 		}
 		return this;
@@ -175,7 +175,7 @@
 		T[0][0] = cos + (1 - cos) * UU[0][0]; T[0][1] = (1 - cos) * UU[0][1] - u.z * sin; T[0][2] = (1 - cos) * UU[0][2] + u.y * sin;
 		T[1][0] = (1 - cos) * UU[1][0] + u.z * sin; T[1][1] = cos + (1 - cos) * UU[1][1]; T[1][2] = (1 - cos) * UU[1][2] - u.x * sin;
 		T[2][0] = (1 - cos) * UU[2][0] - u.y * sin; T[2][1] = (1 - cos) * UU[2][1] + u.x * sin; T[2][2] = cos + (1 - cos) * UU[2][2];
-		for(int i = v.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = v.length - 1;0 <= i;i --){
 			v[i] = new Vector3(
 				T[0][0] * v[i].x + T[0][1] * v[i].y + T[0][2] * v[i].z ,
 				T[1][0] * v[i].x + T[1][1] * v[i].y + T[1][2] * v[i].z ,
@@ -187,7 +187,7 @@
 	
 	public Shape translate(float x,float y,float z){
 		Vector3 dvec = new Vector3(x,y,z);
-		for(int i = fixedV.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = fixedV.length - 1;0 <= i;i --){
 			fixedV[i] += dvec;
 		}
 		resetVertex();
@@ -196,7 +196,7 @@
 	
 	
 	public Shape transformMatrix(Matrix t){
-		for(int i = v.length - 1;0 <= i;i --){
+		for(ptrdiff_t i = v.length - 1;0 <= i;i --){
 			v[i] = vec3translate(v[i] , t);
 		}
 		return this;
@@ -262,15 +262,15 @@
 		polygons.length = a.length;
 		for(int i=0;i<a.length-1;i++){
 			wires[0][i] = i;
-			polygons[i].v[0] = v.length-1;
+			polygons[i].v[0] = cast(int)(v.length-1);
 			polygons[i].v[1] = i;
 			polygons[i].v[2] = i+1;
 			polygons[i].normal = new Vector3(0.0f ,0.0f ,1.0f);
 		}
-		wires[0] ~= a.length -1;
+		wires[0] ~= cast(int)(a.length -1);
 		wires[0] ~= 0;
-		polygons[a.length-1].v[0] = v.length-1;
-		polygons[a.length-1].v[1] = a.length-1;
+		polygons[a.length-1].v[0] = cast(int)(v.length-1);
+		polygons[a.length-1].v[1] = cast(int)(a.length-1);
 		polygons[a.length-1].v[2] = 0;
 		polygons[a.length-1].normal = new Vector3(0.0f ,0.0f ,1.0f);
 		set(v ,wires ,polygons);
@@ -280,7 +280,7 @@
 
 public class SH_Pole:Shape{
 
-	public this(float[] a ,float[] b ,int segment){
+	public this(const(float)[] a ,const(float)[] b ,int segment){
 		if(a.length != b.length || a.length < 1){
 			Log_write("Pole  arguments error" );
 			throw new Exception("Pole  arguments error" );
@@ -310,8 +310,8 @@
 			Log_write("Pole  arguments error" );
 			throw new Exception("Pole  arguments error" );
 		}
-		int maxNum = 0;
-		 for(int i = a.length -1;0 <= i;i --){
+		ptrdiff_t maxNum = 0;
+		 for(ptrdiff_t i = a.length -1;0 <= i;i --){
       if(a[i].length != b[i].length || a[i].length < 1){
         Log_write("Pole  arguments error" );
 				throw new Exception("Pole  arguments error" );
@@ -324,7 +324,7 @@
 		for(int i = segment - 1;0 <= i;i --){
 			vec[i].length = maxNum;
 		}
-		int k,l;
+		ptrdiff_t k,l;
 		k = 0;
 		for(int i = 0;i < segment ;i ++){
       for(int j = 0;j < maxNum ;j ++){
@@ -346,8 +346,8 @@
 		polygon[] tpolygons;
 		int[] twires;
 		
-		int number = vec[0].length;
-		for(int i = vec.length -1;0 <= i;i --){
+		ptrdiff_t number = vec[0].length;
+		for(ptrdiff_t i = vec.length -1;0 <= i;i --){
       if(vec[i].length != number || number < 1){
         Log_write("Pole joint arguments error" );
 				throw new Exception("Pole joint arguments error" );
@@ -366,7 +366,7 @@
       twires[num] = j;
       num ++;
       for(int i = 0;i < vec.length ;i ++){
-				twires[num] = i * vec[0].length + j;
+				twires[num] = cast(int)(i * vec[0].length + j);
         num ++;
       }
       twires[num] = j;
@@ -377,30 +377,30 @@
     while(true){
       seg ++;
       if(vec.length <= seg)break; 
-      for(int j = vec[0].length - 1;0 <= j ;j --){
-				twires[num] = seg * vec[0].length + j;
+      for(ptrdiff_t j = vec[0].length - 1;0 <= j ;j --){
+				twires[num] = cast(int)(seg * vec[0].length + j);
         num ++;
       }
       seg ++;
       if(vec.length <= seg)break; 
       for(int j = 0;j < vec[0].length ;j ++){
-				twires[num] = seg * vec[0].length + j;
+				twires[num] = cast(int)(seg * vec[0].length + j);
         num ++;
       }
     }
 		//make polygon
 		///*
-		tpolygons.length = vec.length  * (vec[0].length - 1) * 2;
+		tpolygons.length = cast(int)(vec.length  * (vec[0].length - 1) * 2);
 		num = 0;
 		for(int i = 0;i < vec[0].length -1 ;i ++){
-			tpolygons[num].v[0] = (vec.length - 1) * vec[0].length + i;
-			tpolygons[num].v[2] = (vec.length - 1) * vec[0].length + i + 1;
-			tpolygons[num].v[1] = i;
+			tpolygons[num].v[0] = cast(int)((vec.length - 1) * vec[0].length + i);
+			tpolygons[num].v[2] = cast(int)((vec.length - 1) * vec[0].length + i + 1);
+			tpolygons[num].v[1] = cast(int)(i);
 			tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);//vec3NormalLine(tv[tpolygons[num].v[0]] ,tv[tpolygons[num].v[1]] ,tv[tpolygons[num].v[3]]);
 		//	polygons[num].normal = getNormal(polygons[num].v);//vec3NormalLine(polygons[num].v[0] ,polygons[num].v[2], polygons[num].v[3]);
 			num ++;
 			tpolygons[num].v[0] = i+1;
-			tpolygons[num].v[1] = (vec.length - 1) * vec[0].length + i+1;
+			tpolygons[num].v[1] = cast(int)((vec.length - 1) * vec[0].length + i+1);
 			tpolygons[num].v[2] = i;
 			tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			num++;
@@ -408,15 +408,15 @@
 		///*
 		for(int i = 0;i < vec.length - 1;i ++){
 			for(int j = 0;j < vec[i].length - 1;j ++){
-				tpolygons[num].v[0] = i * vec[0].length + j;
-				tpolygons[num].v[2] = i * vec[0].length + j + 1;
-				tpolygons[num].v[1] = (i + 1) * vec[0].length + j;
+				tpolygons[num].v[0] = cast(int)(i * vec[0].length + j);
+				tpolygons[num].v[2] = cast(int)(i * vec[0].length + j + 1);
+				tpolygons[num].v[1] = cast(int)((i + 1) * vec[0].length + j);
 				tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			//	polygons[num].normal = getNormal(polygons[num].v);//vec3NormalLine(polygons[num].v[0] ,polygons[num].v[2], polygons[num].v[3]);
 				num ++;
-				tpolygons[num].v[0] = (i + 1) * vec[0].length + j+1;
-				tpolygons[num].v[1] = i * vec[0].length + j+1;
-				tpolygons[num].v[2] = (i+1) * vec[0].length + j;
+				tpolygons[num].v[0] = cast(int)((i + 1) * vec[0].length + j+1);
+				tpolygons[num].v[1] = cast(int)(i * vec[0].length + j+1);
+				tpolygons[num].v[2] = cast(int)((i+1) * vec[0].length + j);
 				tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 				num++;
 			}
@@ -468,8 +468,8 @@
 		int[][] twires;
 		
 		
-		int number = vec[0].length;
-		for(int i = vec.length -1;0 <= i;i --){
+		ptrdiff_t number = vec[0].length;
+		for(ptrdiff_t i = vec.length -1;0 <= i;i --){
       if(vec[i].length != number || number < 1){
         Log_write("Pot joint arguments error" );
 				throw new Exception("Pot joint arguments error" );
@@ -486,18 +486,18 @@
 		for(int i = 0;i < vec.length;i ++){
 			twires[i].length = vec[i].length + 1;
 		}
-		for(int i = vec.length;i < twires.length;i ++){
+		for(ptrdiff_t i = vec.length;i < twires.length;i ++){
 			twires[i].length = vec.length;
 		}
 		for(int i = 0;i < vec.length;i ++){
 			for(int j = 0;j < vec[i].length;j ++){
-				twires[i][j] = i * vec[0].length + j;
+				twires[i][j] = cast(int)(i * vec[0].length + j);
 			}
-			twires[i][vec[i].length] = i * vec[0].length + 0;
+			twires[i][vec[i].length] = cast(int)(i * vec[0].length + 0);
 		}
 		for(int j = 0;j < vec[0].length;j ++){
 			for(int i = 0;i < vec.length;i ++){
-				twires[vec.length + j][i] = i * vec[0].length + j;
+				twires[vec.length + j][i] = cast(int)(i * vec[0].length + j);
 			}
 		}
 		int num = 0;
@@ -540,33 +540,33 @@
 		num = 0;
 		for(int i = 0;i < vec.length - 1;i ++){
 			for(int j = 0;j < vec[0].length - 1;j ++){
-				tpolygons[num].v[0] = i * vec[0].length + j;
-				tpolygons[num].v[1] = (i + 1) * vec[0].length + j;
-				tpolygons[num].v[2] = i * vec[0].length + j + 1;
-//				tpolygons[num].v[3] = i * vec[0].length + j + 1;
+				tpolygons[num].v[0] = cast(int)(i * vec[0].length + j);
+				tpolygons[num].v[1] = cast(int)((i + 1) * vec[0].length + j);
+				tpolygons[num].v[2] = cast(int)(i * vec[0].length + j + 1);
+//				tpolygons[num].v[3] = cast(int)(i * vec[0].length + j + 1);
 				tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 				num ++;
-				tpolygons[num].v[0] = (i + 1) * vec[0].length + j + 1;
-				tpolygons[num].v[2] = (i + 1) * vec[0].length + j;
-				tpolygons[num].v[1] = i * vec[0].length + j + 1;
+				tpolygons[num].v[0] = cast(int)((i + 1) * vec[0].length + j + 1);
+				tpolygons[num].v[2] = cast(int)((i + 1) * vec[0].length + j);
+				tpolygons[num].v[1] = cast(int)(i * vec[0].length + j + 1);
 				tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 				num ++;
 			}
 		}
 		for(int i = 0;i < vec.length - 1;i ++){
-			tpolygons[num].v[0] = i * vec[0].length + vec[0].length - 1;
-			tpolygons[num].v[1] = (i + 1) * vec[0].length + vec[0].length - 1;
-			tpolygons[num].v[2] = i * vec[0].length + 0;
+			tpolygons[num].v[0] = cast(int)(i * vec[0].length + vec[0].length - 1);
+			tpolygons[num].v[1] = cast(int)((i + 1) * vec[0].length + vec[0].length - 1);
+			tpolygons[num].v[2] = cast(int)(i * vec[0].length + 0);
 			
 			tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			num ++;
-			tpolygons[num].v[0] = (i+1) * vec[0].length + 0;
-			tpolygons[num].v[2] = (i + 1) * vec[0].length + vec[0].length - 1;
-			tpolygons[num].v[1] = i * vec[0].length + 0;
+			tpolygons[num].v[0] = cast(int)((i+1) * vec[0].length + 0);
+			tpolygons[num].v[2] = cast(int)((i + 1) * vec[0].length + vec[0].length - 1);
+			tpolygons[num].v[1] = cast(int)(i * vec[0].length + 0);
 			tpolygons[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			num ++;
 		}
-		int length = vec.length;
+		ptrdiff_t length = vec.length;
 		if((1e-6) <= vec[0][0].size()){
 			polygon[] cover;
 			tv.length = tv.length + vec[0].length;
@@ -577,29 +577,29 @@
 			}
 			num = 0;
 			for(int j = 0;j < vec[0].length - 1;j ++){
-				cover[num].v[0] = (length - 1) * vec[0].length + j;
-				cover[num].v[1] = 0 * vec[0].length + j;
-				cover[num].v[2] = 0 * vec[0].length + j + 1;
+				cover[num].v[0] = cast(int)((length - 1) * vec[0].length + j);
+				cover[num].v[1] = cast(int)(0 * vec[0].length + j);
+				cover[num].v[2] = cast(int)(0 * vec[0].length + j + 1);
 				
 				cover[num].normal = vec3NormalLine(tv[cover[num].v[0]],tv[cover[num].v[1]],tv[cover[num].v[2]]);
 				num ++;
 				/*
-				cover[num].v[0] = 0 * vec[0].length + j + 1;
-				cover[num].v[1] = (length - 1) * vec[0].length + j;
-				cover[num].v[2] = 0 * vec[0].length + j;
+				cover[num].v[0] = cast(int)(0 * vec[0].length + j + 1);
+				cover[num].v[1] = cast(int)((length - 1) * vec[0].length + j);
+				cover[num].v[2] = cast(int)(0 * vec[0].length + j);
 				cover[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 				num ++;
 				*/
 			}
-			cover[num].v[0] = (length - 1) * vec[0].length + vec[0].length - 1;
-			cover[num].v[1] = 0 * vec[0].length + vec[0].length - 1;
-			cover[num].v[2] = 0 * vec[0].length + 0;
+			cover[num].v[0] = cast(int)((length - 1) * vec[0].length + vec[0].length - 1);
+			cover[num].v[1] = cast(int)(0 * vec[0].length + vec[0].length - 1);
+			cover[num].v[2] = cast(int)(0 * vec[0].length + 0);
 			cover[num].normal =  vec3NormalLine(tv[cover[num].v[0]],tv[cover[num].v[1]],tv[cover[num].v[2]]);
 			num ++;
 			/*
-			cover[num].v[0] = 0 * vec[0].length + 0;
-			cover[num].v[1] = (length - 1) * vec[0].length + vec[0].length - 1;
-			cover[num].v[2] = 0 * vec[0].length + vec[0].length - 1;
+			cover[num].v[0] = cast(int)(0 * vec[0].length + 0);
+			cover[num].v[1] = cast(int)((length - 1) * vec[0].length + vec[0].length - 1);
+			cover[num].v[2] = cast(int)(0 * vec[0].length + vec[0].length - 1);
 			cover[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			num ++;
 			*/
@@ -615,28 +615,28 @@
 			}
 			num = 0;
 			for(int j = 0;j < vec[0].length - 1;j ++){
-				cover[num].v[0] = (length - 1) * vec[0].length + j;
-				cover[num].v[2] = (vec.length - 1) * vec[0].length + j;
-				cover[num].v[1] = (vec.length - 1) * vec[0].length + j + 1;
+				cover[num].v[0] = cast(int)((length - 1) * vec[0].length + j);
+				cover[num].v[2] = cast(int)((vec.length - 1) * vec[0].length + j);
+				cover[num].v[1] = cast(int)((vec.length - 1) * vec[0].length + j + 1);
 				cover[num].normal =  vec3NormalLine(tv[cover[num].v[0]],tv[cover[num].v[1]],tv[cover[num].v[2]]);
 				num ++;
 				/*
-				cover[num].v[0] = (vec.length - 1) * vec[0].length + j + 1;
-				cover[num].v[1] = (length - 1) * vec[0].length + j;
-				cover[num].v[2] = (vec.length - 1) * vec[0].length + j;
+				cover[num].v[0] = cast(int)((vec.length - 1) * vec[0].length + j + 1);
+				cover[num].v[1] = cast(int)((length - 1) * vec[0].length + j);
+				cover[num].v[2] = cast(int)((vec.length - 1) * vec[0].length + j);
 				cover[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 				num ++;
 				*/
 			}
-			cover[num].v[0] = (length - 1) * vec[0].length + vec[0].length - 1;
-			cover[num].v[2] = (vec.length - 1) * vec[0].length + vec[0].length - 1;
-			cover[num].v[1] = (vec.length - 1) * vec[0].length + 0;
+			cover[num].v[0] = cast(int)((length - 1) * vec[0].length + vec[0].length - 1);
+			cover[num].v[2] = cast(int)((vec.length - 1) * vec[0].length + vec[0].length - 1);
+			cover[num].v[1] = cast(int)((vec.length - 1) * vec[0].length + 0);
 			cover[num].normal =  vec3NormalLine(tv[cover[num].v[0]],tv[cover[num].v[1]],tv[cover[num].v[2]]);
 			num ++;
 			/*
-			cover[num].v[0] = (vec.length - 1) * vec[0].length + 0;
-			cover[num].v[1] = (length - 1) * vec[0].length + vec[0].length - 1;
-			cover[num].v[2] = (vec.length - 1) * vec[0].length + vec[0].length - 1;
+			cover[num].v[0] = cast(int)((vec.length - 1) * vec[0].length + 0);
+			cover[num].v[1] = cast(int)((length - 1) * vec[0].length + vec[0].length - 1);
+			cover[num].v[2] = cast(int)((vec.length - 1) * vec[0].length + vec[0].length - 1);
 			cover[num].normal = vec3NormalLine(tv[tpolygons[num].v[0]],tv[tpolygons[num].v[1]],tv[tpolygons[num].v[2]]);
 			num ++;
 			*/
@@ -708,4 +708,4 @@
 		}
 		super(a ,b);
 	}
-}
\ No newline at end of file
+}
--- a/src/br/laserImpl.d
+++ b/src/br/laserImpl.d
@@ -12,11 +12,11 @@
 
 public Shape LASERSHAPE;
 public class LaserImpl:Laser{
-	private static const float[][] a=[
-	[0.0f ,0.02f  ,1.0f]
+	private static const float[] a=[
+	0.0f ,0.02f  ,1.0f
 	];
-	private static const float[][] b=[
-	[0.1f ,0.8f ,1.0f]
+	private static const float[] b=[
+	0.1f ,0.8f ,1.0f
 	];
 	public this(float size=20.0f,Vector3 pos = new Vector3() ,Matrix poseBase = new Matrix()){
 		super(pos ,poseBase);
@@ -37,11 +37,11 @@
 		collisionManager.add(this ,CollisionManager.kind.LASER ,1);
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if(parent is null)vanish();
 		poseX ++;
 //		pos.y --;
 	}
 	
-}
\ No newline at end of file
+}
--- a/src/br/shapeImpl.d
+++ b/src/br/shapeImpl.d
@@ -158,7 +158,7 @@
 	       [-0.75 ,0.75 ,-0.25 ]
 	       ;
 		static float[] z =
-					[ ,0 ,0.75];
+					[  0 ,0.75];
 		static float[] scale =
 					[1.0 ,0.0];
 	}
@@ -633,4 +633,4 @@
 		return new SH_Pole(a ,b ,4);
 	}
 	
-}
\ No newline at end of file
+}
--- a/src/util/matrix.d
+++ b/src/util/matrix.d
@@ -55,7 +55,9 @@
 			}
 		}
 	}
-	public bool opEquals(Matrix t){
+	public override bool opEquals(Object o){
+		Matrix t = cast(Matrix)o;
+		if (!t) return false;
 		bool result = true;
 		for(int i = 0;i < m.length;i ++){
 			for(int j = 0;j < m[i].length;j ++){
@@ -170,4 +172,4 @@
 	}
 	result = new Vector3(r4[0] ,r4[1] ,r4[2]);
 	return result;
-}
\ No newline at end of file
+}
--- a/src/util/vector.d
+++ b/src/util/vector.d
@@ -80,8 +80,9 @@
 	public Vector opSub(Vector v){
 		return new Vector(x - v.x ,y - v.y);
 	}
-	public bool opEquals(Vector v){
-		return (x == v.x) && (y == v.y);
+	public override bool opEquals(Object o){
+		Vector v = cast(Vector)o;
+		return v && (x == v.x) && (y == v.y);
 	}
 	public void opAddAssign(Vector v) {
     x += v.x;
@@ -178,8 +179,9 @@
 	public Vector3 opDiv(float div){
 		return new Vector3(x / div ,y / div ,z /div);
 	}
-	public bool opEquals(Vector3 v){
-		return (x == v.x) && (y == v.y) && (z == v.z);
+	public override bool opEquals(Object o){
+		Vector3 v = cast(Vector3)o;
+		return v && (x == v.x) && (y == v.y) && (z == v.z);
 	}
   public void opAddAssign(Vector3 v) {
     x += v.x;
--- a/src/util/font.d
+++ b/src/util/font.d
@@ -1,3 +1 @@
 module util.font;
-private import SDL;
-private import SDL_ttf;
--- a/src/br/append.d
+++ b/src/br/append.d
@@ -37,7 +37,7 @@
 		this.collisionRange = collisionSize;
 		drawing = POLYGON | WIRE;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(parentExist & (parent is null || parent.exists == false)){
 			parentExist = false;
@@ -49,7 +49,7 @@
 			if(vanishCount < 0)destroy();
 		}
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,wR,wG,wB,alpha);
 	}
@@ -153,4 +153,4 @@
 		
 	}
 }
-+/
\ No newline at end of file
++/
--- a/src/br/cursor.d
+++ b/src/br/cursor.d
@@ -41,7 +41,7 @@
 		
 	}
 	
-	public void move(){
+	public override void move(){
 		MouseState ms = mouse.getState();
 		
 		super.move();
@@ -88,7 +88,7 @@
 		wR = 0.0;wG =0.0;wB = 0.0;walpha = 1.0;
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt == 1)fixDist = dist;
 //		dist = fixDist * (sin(cast(double)(cnt % 120)*PI/60.0f) * 0.2f + 0.8f);
@@ -99,4 +99,4 @@
 		
 
 	}
-}
\ No newline at end of file
+}
--- a/src/br/pattern.d
+++ b/src/br/pattern.d
@@ -25,7 +25,7 @@
 //		hp = 3;
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if(border && (rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size ||
 			screen.GAME_RIGHT  < rpos.x-size || rpos.x+size < screen.GAME_LEFT ||
@@ -41,7 +41,7 @@
 	public override void reportCollision(int kind ,Parts p){
 		
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 //		makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha);
 
@@ -63,7 +63,7 @@
 		this.vel = cast(Vector3)vel.clone();
 		poseZ = atan2(vel.y,vel.x)*180.0/PI;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt  == 60){
 			Vector3 v = vec3Normalize(ship.rpos -rpos) * 1.0f;
@@ -93,7 +93,7 @@
 		this.vel = cast(Vector3)vel.clone();
 		poseZ = 45;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		
@@ -119,7 +119,7 @@
 		poseZ = 90;
 		poseY =45;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		dist = RADIUS;
 //		poseZ ++;
@@ -140,10 +140,10 @@
 		drawing =  WIRE;
 		
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		linkZ += mulsp(0.4);
 		linkY += mulsp(0.1);
 	}
 	
-}
\ No newline at end of file
+}
--- a/src/br/shot.d
+++ b/src/br/shot.d
@@ -32,7 +32,7 @@
 		shotManager.add(this);
 	}
 	
-	public void move(){
+	public override void move(){
 		super.move();
 		if(cnt <=1)size = 0.0f;
 //		else if(cnt == 3)size = SIZE * 2.0f / 3.0f;
@@ -52,9 +52,9 @@
 	public override void reportCollision(int kind ,Parts p){
 		destroy();
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		makeSimpleParticle(2, size/5.0f ,WIRE ,rpos ,R ,G ,B ,wR,wG,wB,alpha);
 
 	}
-}
\ No newline at end of file
+}
--- a/src/br/star.d
+++ b/src/br/star.d
@@ -34,7 +34,7 @@
 		
 		hp = 3;
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		if((rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size ||
 			screen.GAME_RIGHT  < rpos.x-size || rpos.x+size < screen.GAME_LEFT ||
@@ -51,7 +51,7 @@
 		Sound_PlaySe(se_kind.STAR);
 		destroy();
 	}
-	public void destroy(){
+	public override void destroy(){
 		super.destroy();
 		makeParticleByShape(shape,4, size*0.7f ,WIRE |POLYGON ,ship.rpos ,new Vector3() ,R ,G ,B ,wR,wG,wB,alpha);
 
@@ -63,7 +63,7 @@
 	public this(Vector3 pos ,Vector3 vel){
 		super(pos ,vel);
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		pos += mulsp(vel);
@@ -77,7 +77,7 @@
 	public this(Vector3 pos ,Vector3 vel){
 		super(pos ,vel);
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		
 		Vector3 t = ship.rpos -rpos;
@@ -87,4 +87,4 @@
 		poseZ += mulsp(3f);
 	}
 	
-}
\ No newline at end of file
+}
--- a/src/util/animationImpl.d
+++ b/src/util/animationImpl.d
@@ -19,7 +19,7 @@
 		this.alpha = alpha;
 		this.delay = delay;
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.rotate(degType ,sin(((count) % divsp(span)) * PI * 2.0 / divsp(span) + delay *PI/180.0) * mulsp(amp) , alpha);
@@ -41,14 +41,14 @@
 		this.dDeg = 0;
 		this.alpha = alpha;
 	}
-	public void set(Parts parts){
+	public override void set(Parts parts){
 		super.set(parts);
 		if(abs(divsp(span) - count) > (1e-6)){
 			dDeg =(targetDeg - *parts.pDeg(degType)) / cast(double)(divsp(span) - count + 1);
 			
 		}
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.rotate(degType ,dDeg , alpha);
@@ -65,7 +65,7 @@
 		super(span ,repeat);
 		this.tdist = tdist;
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			if(count <= divsp(span)){
@@ -97,7 +97,7 @@
 		this.tlinkx = tdegx;this.tlinky = tdegy;this.tlinkz = tdegz;
 		this.tposex = tdegx2;this.tposey = tdegy2;this.tposez = tdegz2;
 	}
-	public void set(Parts parts){
+	public override void set(Parts parts){
 		super.set(parts);
 		/*
 		if(abs(span - count) > (1e-6)){
@@ -105,7 +105,7 @@
 		}
 		*/
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			if(count <= divsp(span)){
@@ -147,7 +147,7 @@
 		this.dDeg = dDeg;
 		this.alpha = alpha;
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.rotate(degType ,mulsp(dDeg) , alpha);
@@ -161,7 +161,7 @@
 		super(span ,repeat);
 		this.d = cast(Matrix)d.clone();
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.rotateAll(d);
@@ -180,13 +180,13 @@
 		this.dDist = 0;
 		this.alpha = alpha;
 	}
-	public void set(Parts parts){
+	public override void set(Parts parts){
 		super.set(parts);
 		if(abs(span - count) > (1e-6)){
 			dDist = (targetDist - parts.dist) / cast(double)(span - count);
 		}
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.dist += dDist;
@@ -205,11 +205,11 @@
 		this.targetSize = targetSize;
 		
 	}
-	public void set(Parts parts){
+	public override void set(Parts parts){
 		super.set(parts);
 		
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			if(count <= divsp(span)){
@@ -230,11 +230,11 @@
 		this.dSize = dSize;
 		
 	}
-	public void set(Parts parts){
+	public override void set(Parts parts){
 		super.set(parts);
 		
 	}
-	public void run(){
+	public override void run(){
 		super.run();
 		if(parts !is null && parts.exists){
 			parts.size = parts.size +  dSize * sin(cast(double)count/cast(double)span*PI + PI/2.0);
@@ -243,4 +243,4 @@
 	}
 	
 	
-}
\ No newline at end of file
+}
--- a/src/util/laser.d
+++ b/src/util/laser.d
@@ -8,10 +8,10 @@
 	public this(Vector3 pos = new Vector3() ,Matrix poseBase = new Matrix()){
 		super(pos ,poseBase);
 	}
-	public void move(){
+	public override void move(){
 		super.move();
 		laseraim = poseVector();
 	}
 	
 	
-}
\ No newline at end of file
+}
