summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-action/area2048/files/area2048-1.03.diff')
-rw-r--r--games-action/area2048/files/area2048-1.03.diff2469
1 files changed, 2469 insertions, 0 deletions
diff --git a/games-action/area2048/files/area2048-1.03.diff b/games-action/area2048/files/area2048-1.03.diff
new file mode 100644
index 0000000..4b12836
--- /dev/null
+++ b/games-action/area2048/files/area2048-1.03.diff
@@ -0,0 +1,2469 @@
+diff -Naur a2k-org/a2k_src/import/opengl.d a2k/a2k_src/import/opengl.d
+--- a2k-org/a2k_src/import/opengl.d 2008-02-12 22:20:18.000000000 +0100
++++ a2k/a2k_src/import/opengl.d 2008-10-07 10:47:18.000000000 +0200
+@@ -1,16 +1,6 @@
+-version (Win32) {
+- import std.c.windows.windows;
+-}
+-extern(System):
+-
+-/* Please use this code with old D compiler.
+-version (Win32) {
+- extern(Windows):
+-}
+-else {
++
+ extern(C):
+-}
+-*/
++
+
+ alias uint GLenum;
+ alias ubyte GLboolean;
+@@ -1122,7 +1112,7 @@
+ /*************************************************************/
+
+ void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
+-void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf cref);
++void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf);
+ GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
+ void /*APIENTRY*/glArrayElement (GLint i);
+ void /*APIENTRY*/glBegin (GLenum mode);
+@@ -1375,7 +1365,7 @@
+ void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+ void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
+ void /*APIENTRY*/glShadeModel (GLenum mode);
+-void /*APIENTRY*/glStencilFunc (GLenum func, GLint cref, GLuint mask);
++void /*APIENTRY*/glStencilFunc (GLenum func, GLint, GLuint mask);
+ void /*APIENTRY*/glStencilMask (GLuint mask);
+ void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+ void /*APIENTRY*/glTexCoord1d (GLdouble s);
+diff -Naur a2k-org/a2k_src/import/openglu.d a2k/a2k_src/import/openglu.d
+--- a2k-org/a2k_src/import/openglu.d 2008-02-12 22:20:14.000000000 +0100
++++ a2k/a2k_src/import/openglu.d 2008-10-07 10:47:18.000000000 +0200
+@@ -1,15 +1,6 @@
+-import opengl;
+
+-extern(System):
+-
+-/* Please use this code with old D compiler.
+-version (Win32) {
+- extern(Windows):
+-}
+-else {
+ extern(C):
+-}
+-*/
++
+
+ GLubyte* gluErrorString (
+ GLenum errCode);
+diff -Naur a2k-org/a2k_src/import/SDL_active.d a2k/a2k_src/import/SDL_active.d
+--- a2k-org/a2k_src/import/SDL_active.d 2006-07-26 23:24:30.000000000 +0200
++++ a2k/a2k_src/import/SDL_active.d 2002-01-04 15:25:02.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ /* Include file for SDL application focus event handling */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_audio.d a2k/a2k_src/import/SDL_audio.d
+--- a2k-org/a2k_src/import/SDL_audio.d 2006-07-26 23:24:40.000000000 +0200
++++ a2k/a2k_src/import/SDL_audio.d 2002-05-22 07:38:58.000000000 +0200
+@@ -20,10 +20,10 @@
+ slouken@devolution.com
+ */
+
+-public import SDL_types;
+-public import SDL_error;
+-public import SDL_rwops;
+-public import SDL_byteorder;
++import SDL_types;
++import SDL_error;
++import SDL_rwops;
++import SDL_byteorder;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_cdrom.d a2k/a2k_src/import/SDL_cdrom.d
+--- a2k-org/a2k_src/import/SDL_cdrom.d 2006-07-26 23:24:42.000000000 +0200
++++ a2k/a2k_src/import/SDL_cdrom.d 2002-05-22 07:44:28.000000000 +0200
+@@ -22,7 +22,7 @@
+
+ /* This is the CD-audio control API for Simple DirectMedia Layer */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL.d a2k/a2k_src/import/SDL.d
+--- a2k-org/a2k_src/import/SDL.d 2006-07-26 23:24:12.000000000 +0200
++++ a2k/a2k_src/import/SDL.d 2008-10-07 10:47:18.000000000 +0200
+@@ -33,60 +33,60 @@
+ public import SDL_byteorder;
+ public import SDL_Version;
+
+-extern(C):
+-
+-/* As of version 0.5, SDL is loaded dynamically into the application */
+-
+-/* These are the flags which may be passed to SDL_Init() -- you should
+- specify the subsystems which you will be using in your application.
+-*/
+-const uint SDL_INIT_TIMER = 0x00000001;
+-const uint SDL_INIT_AUDIO = 0x00000010;
+-const uint SDL_INIT_VIDEO = 0x00000020;
+-const uint SDL_INIT_CDROM = 0x00000100;
+-const uint SDL_INIT_JOYSTICK = 0x00000200;
+-const uint SDL_INIT_NOPARACHUTE = 0x00100000; /* Don't catch fatal signals */
+-const uint SDL_INIT_EVENTTHREAD = 0x01000000; /* Not supported on all OS's */
+-const uint SDL_INIT_EVERYTHING = 0x0000FFFF;
+-
+-/* This function loads the SDL dynamically linked library and initializes
+- * the subsystems specified by 'flags' (and those satisfying dependencies)
+- * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
+- * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
+- */
+-int SDL_Init(Uint32 flags);
+-
+-/* This function initializes specific SDL subsystems */
+-int SDL_InitSubSystem(Uint32 flags);
+-
+-/* This function cleans up specific SDL subsystems */
+-void SDL_QuitSubSystem(Uint32 flags);
+-
+-/* This function returns mask of the specified subsystems which have
+- been initialized.
+- If 'flags' is 0, it returns a mask of all initialized subsystems.
+-*/
+-Uint32 SDL_WasInit(Uint32 flags);
+-
+-/* This function cleans up all initialized subsystems and unloads the
+- * dynamically linked library. You should call it upon all exit conditions.
+- */
+-void SDL_Quit();
+-
+-void SDL_SetModuleHandle(void *hInst);
+-//extern(Windows) void* GetModuleHandle(char*);
+-extern(Windows) void* GetModuleHandleA(char*);
+-
+-static this()
+-{
+- /* Load SDL dynamic link library */
+- if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
+- throw new Error("Error loading SDL");
+-// SDL_SetModuleHandle(GetModuleHandle(null));
+- SDL_SetModuleHandle(GetModuleHandleA(null));
+-}
+-
+-static ~this()
+-{
+- SDL_Quit();
+-}
++extern(C):
++
++/* As of version 0.5, SDL is loaded dynamically into the application */
++
++/* These are the flags which may be passed to SDL_Init() -- you should
++ specify the subsystems which you will be using in your application.
++*/
++const uint SDL_INIT_TIMER = 0x00000001;
++const uint SDL_INIT_AUDIO = 0x00000010;
++const uint SDL_INIT_VIDEO = 0x00000020;
++const uint SDL_INIT_CDROM = 0x00000100;
++const uint SDL_INIT_JOYSTICK = 0x00000200;
++const uint SDL_INIT_NOPARACHUTE = 0x00100000; /* Don't catch fatal signals */
++const uint SDL_INIT_EVENTTHREAD = 0x01000000; /* Not supported on all OS's */
++const uint SDL_INIT_EVERYTHING = 0x0000FFFF;
++
++/* This function loads the SDL dynamically linked library and initializes
++ * the subsystems specified by 'flags' (and those satisfying dependencies)
++ * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
++ * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
++ */
++int SDL_Init(Uint32 flags);
++
++/* This function initializes specific SDL subsystems */
++int SDL_InitSubSystem(Uint32 flags);
++
++/* This function cleans up specific SDL subsystems */
++void SDL_QuitSubSystem(Uint32 flags);
++
++/* This function returns mask of the specified subsystems which have
++ been initialized.
++ If 'flags' is 0, it returns a mask of all initialized subsystems.
++*/
++Uint32 SDL_WasInit(Uint32 flags);
++
++/* This function cleans up all initialized subsystems and unloads the
++ * dynamically linked library. You should call it upon all exit conditions.
++ */
++void SDL_Quit();
++
++/+
++void SDL_SetModuleHandle(void *hInst);
++extern(Windows) void* GetModuleHandle(char*);
++
++static this()
++{
++ /* Load SDL dynamic link library */
++ if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
++ throw new Error("Error loading SDL");
++ SDL_SetModuleHandle(GetModuleHandle(null));
++}
++
++static ~this()
++{
++ SDL_Quit();
++}
+++/
+diff -Naur a2k-org/a2k_src/import/SDL_endian.d a2k/a2k_src/import/SDL_endian.d
+--- a2k-org/a2k_src/import/SDL_endian.d 2006-09-14 01:57:50.000000000 +0200
++++ a2k/a2k_src/import/SDL_endian.d 2004-05-08 12:55:52.000000000 +0200
+@@ -34,9 +34,9 @@
+ and other data sources.
+ */
+
+-public import SDL_types;
+-public import SDL_rwops;
+-public import SDL_byteorder;
++import SDL_types;
++import SDL_rwops;
++import SDL_byteorder;
+
+ extern(C):
+
+@@ -47,7 +47,7 @@
+ */
+
+ Uint16 SDL_Swap16(Uint16 D) {
+- return cast(Uint16)((D<<8)|(D>>8));
++ return((D<<8)|(D>>8));
+ }
+
+ Uint32 SDL_Swap32(Uint32 D) {
+diff -Naur a2k-org/a2k_src/import/SDL_events.d a2k/a2k_src/import/SDL_events.d
+--- a2k-org/a2k_src/import/SDL_events.d 2006-07-26 23:25:46.000000000 +0200
++++ a2k/a2k_src/import/SDL_events.d 2008-10-07 10:47:18.000000000 +0200
+@@ -22,12 +22,12 @@
+
+ /* Include file for SDL event handling */
+
+-public import SDL_types;
+-public import SDL_active;
+-public import SDL_keyboard;
+-public import SDL_mouse;
+-public import SDL_joystick;
+-public import SDL_syswm;
++import SDL_types;
++import SDL_active;
++import SDL_keyboard;
++import SDL_mouse;
++import SDL_joystick;
++import SDL_syswm;
+
+ extern(C):
+
+@@ -304,7 +304,7 @@
+ If 'state' is set to SDL_QUERY, SDL_EventState() will return the
+ current processing state of the specified event.
+ */
+-const int SDL_QUERY = -1;
++const uint SDL_QUERY = -1;
+ const uint SDL_IGNORE = 0;
+ const uint SDL_DISABLE = 0;
+ const uint SDL_ENABLE = 1;
+diff -Naur a2k-org/a2k_src/import/SDL_image.d a2k/a2k_src/import/SDL_image.d
+--- a2k-org/a2k_src/import/SDL_image.d 2006-07-26 23:24:58.000000000 +0200
++++ a2k/a2k_src/import/SDL_image.d 2004-05-08 14:09:32.000000000 +0200
+@@ -26,7 +26,7 @@
+
+ /* A simple library to load images of various formats as SDL surfaces */
+
+-public import SDL;
++import SDL;
+
+ extern (C) {
+
+diff -Naur a2k-org/a2k_src/import/SDL_joystick.d a2k/a2k_src/import/SDL_joystick.d
+--- a2k-org/a2k_src/import/SDL_joystick.d 2006-07-26 23:25:10.000000000 +0200
++++ a2k/a2k_src/import/SDL_joystick.d 2002-01-04 15:24:10.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ /* Include file for SDL joystick event handling */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_keyboard.d a2k/a2k_src/import/SDL_keyboard.d
+--- a2k-org/a2k_src/import/SDL_keyboard.d 2006-07-26 23:25:14.000000000 +0200
++++ a2k/a2k_src/import/SDL_keyboard.d 2002-01-04 15:28:12.000000000 +0100
+@@ -22,11 +22,11 @@
+
+ /* Include file for SDL keyboard event handling */
+
+-public import SDL_types;
++import SDL_types;
+ // !!! A hack! struct SDL_keysym is defined in this module,
+ // !!! so we need to resolve the nameclash...
+ // !!! Definitely won't work on *NIX but for now will do.
+-public import SDL_Keysym;
++import SDL_Keysym;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_keysym.d a2k/a2k_src/import/SDL_keysym.d
+--- a2k-org/a2k_src/import/SDL_keysym.d 2002-01-04 23:31:22.000000000 +0100
++++ a2k/a2k_src/import/SDL_keysym.d 1970-01-01 01:00:00.000000000 +0100
+@@ -1,308 +0,0 @@
+-/*
+- SDL - Simple DirectMedia Layer
+- Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
+-
+- This library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Library General Public
+- License as published by the Free Software Foundation; either
+- version 2 of the License, or (at your option) any later version.
+-
+- This library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Library General Public License for more details.
+-
+- You should have received a copy of the GNU Library General Public
+- License along with this library; if not, write to the Free
+- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-
+- Sam Lantinga
+- slouken@devolution.com
+-*/
+-
+-/* What we really want is a mapping of every raw key on the keyboard.
+- To support international keyboards, we use the range 0xA1 - 0xFF
+- as international virtual keycodes. We'll follow in the footsteps of X11...
+- The names of the keys
+- */
+-
+-alias int SDLKey;
+-enum {
+- /* The keyboard syms have been cleverly chosen to map to ASCII */
+- SDLK_UNKNOWN = 0,
+- SDLK_FIRST = 0,
+- SDLK_BACKSPACE = 8,
+- SDLK_TAB = 9,
+- SDLK_CLEAR = 12,
+- SDLK_RETURN = 13,
+- SDLK_PAUSE = 19,
+- SDLK_ESCAPE = 27,
+- SDLK_SPACE = 32,
+- SDLK_EXCLAIM = 33,
+- SDLK_QUOTEDBL = 34,
+- SDLK_HASH = 35,
+- SDLK_DOLLAR = 36,
+- SDLK_AMPERSAND = 38,
+- SDLK_QUOTE = 39,
+- SDLK_LEFTPAREN = 40,
+- SDLK_RIGHTPAREN = 41,
+- SDLK_ASTERISK = 42,
+- SDLK_PLUS = 43,
+- SDLK_COMMA = 44,
+- SDLK_MINUS = 45,
+- SDLK_PERIOD = 46,
+- SDLK_SLASH = 47,
+- SDLK_0 = 48,
+- SDLK_1 = 49,
+- SDLK_2 = 50,
+- SDLK_3 = 51,
+- SDLK_4 = 52,
+- SDLK_5 = 53,
+- SDLK_6 = 54,
+- SDLK_7 = 55,
+- SDLK_8 = 56,
+- SDLK_9 = 57,
+- SDLK_COLON = 58,
+- SDLK_SEMICOLON = 59,
+- SDLK_LESS = 60,
+- SDLK_EQUALS = 61,
+- SDLK_GREATER = 62,
+- SDLK_QUESTION = 63,
+- SDLK_AT = 64,
+- /*
+- Skip uppercase letters
+- */
+- SDLK_LEFTBRACKET = 91,
+- SDLK_BACKSLASH = 92,
+- SDLK_RIGHTBRACKET = 93,
+- SDLK_CARET = 94,
+- SDLK_UNDERSCORE = 95,
+- SDLK_BACKQUOTE = 96,
+- SDLK_a = 97,
+- SDLK_b = 98,
+- SDLK_c = 99,
+- SDLK_d = 100,
+- SDLK_e = 101,
+- SDLK_f = 102,
+- SDLK_g = 103,
+- SDLK_h = 104,
+- SDLK_i = 105,
+- SDLK_j = 106,
+- SDLK_k = 107,
+- SDLK_l = 108,
+- SDLK_m = 109,
+- SDLK_n = 110,
+- SDLK_o = 111,
+- SDLK_p = 112,
+- SDLK_q = 113,
+- SDLK_r = 114,
+- SDLK_s = 115,
+- SDLK_t = 116,
+- SDLK_u = 117,
+- SDLK_v = 118,
+- SDLK_w = 119,
+- SDLK_x = 120,
+- SDLK_y = 121,
+- SDLK_z = 122,
+- SDLK_DELETE = 127,
+- /* End of ASCII mapped keysyms */
+-
+- /* International keyboard syms */
+- SDLK_WORLD_0 = 160, /* 0xA0 */
+- SDLK_WORLD_1 = 161,
+- SDLK_WORLD_2 = 162,
+- SDLK_WORLD_3 = 163,
+- SDLK_WORLD_4 = 164,
+- SDLK_WORLD_5 = 165,
+- SDLK_WORLD_6 = 166,
+- SDLK_WORLD_7 = 167,
+- SDLK_WORLD_8 = 168,
+- SDLK_WORLD_9 = 169,
+- SDLK_WORLD_10 = 170,
+- SDLK_WORLD_11 = 171,
+- SDLK_WORLD_12 = 172,
+- SDLK_WORLD_13 = 173,
+- SDLK_WORLD_14 = 174,
+- SDLK_WORLD_15 = 175,
+- SDLK_WORLD_16 = 176,
+- SDLK_WORLD_17 = 177,
+- SDLK_WORLD_18 = 178,
+- SDLK_WORLD_19 = 179,
+- SDLK_WORLD_20 = 180,
+- SDLK_WORLD_21 = 181,
+- SDLK_WORLD_22 = 182,
+- SDLK_WORLD_23 = 183,
+- SDLK_WORLD_24 = 184,
+- SDLK_WORLD_25 = 185,
+- SDLK_WORLD_26 = 186,
+- SDLK_WORLD_27 = 187,
+- SDLK_WORLD_28 = 188,
+- SDLK_WORLD_29 = 189,
+- SDLK_WORLD_30 = 190,
+- SDLK_WORLD_31 = 191,
+- SDLK_WORLD_32 = 192,
+- SDLK_WORLD_33 = 193,
+- SDLK_WORLD_34 = 194,
+- SDLK_WORLD_35 = 195,
+- SDLK_WORLD_36 = 196,
+- SDLK_WORLD_37 = 197,
+- SDLK_WORLD_38 = 198,
+- SDLK_WORLD_39 = 199,
+- SDLK_WORLD_40 = 200,
+- SDLK_WORLD_41 = 201,
+- SDLK_WORLD_42 = 202,
+- SDLK_WORLD_43 = 203,
+- SDLK_WORLD_44 = 204,
+- SDLK_WORLD_45 = 205,
+- SDLK_WORLD_46 = 206,
+- SDLK_WORLD_47 = 207,
+- SDLK_WORLD_48 = 208,
+- SDLK_WORLD_49 = 209,
+- SDLK_WORLD_50 = 210,
+- SDLK_WORLD_51 = 211,
+- SDLK_WORLD_52 = 212,
+- SDLK_WORLD_53 = 213,
+- SDLK_WORLD_54 = 214,
+- SDLK_WORLD_55 = 215,
+- SDLK_WORLD_56 = 216,
+- SDLK_WORLD_57 = 217,
+- SDLK_WORLD_58 = 218,
+- SDLK_WORLD_59 = 219,
+- SDLK_WORLD_60 = 220,
+- SDLK_WORLD_61 = 221,
+- SDLK_WORLD_62 = 222,
+- SDLK_WORLD_63 = 223,
+- SDLK_WORLD_64 = 224,
+- SDLK_WORLD_65 = 225,
+- SDLK_WORLD_66 = 226,
+- SDLK_WORLD_67 = 227,
+- SDLK_WORLD_68 = 228,
+- SDLK_WORLD_69 = 229,
+- SDLK_WORLD_70 = 230,
+- SDLK_WORLD_71 = 231,
+- SDLK_WORLD_72 = 232,
+- SDLK_WORLD_73 = 233,
+- SDLK_WORLD_74 = 234,
+- SDLK_WORLD_75 = 235,
+- SDLK_WORLD_76 = 236,
+- SDLK_WORLD_77 = 237,
+- SDLK_WORLD_78 = 238,
+- SDLK_WORLD_79 = 239,
+- SDLK_WORLD_80 = 240,
+- SDLK_WORLD_81 = 241,
+- SDLK_WORLD_82 = 242,
+- SDLK_WORLD_83 = 243,
+- SDLK_WORLD_84 = 244,
+- SDLK_WORLD_85 = 245,
+- SDLK_WORLD_86 = 246,
+- SDLK_WORLD_87 = 247,
+- SDLK_WORLD_88 = 248,
+- SDLK_WORLD_89 = 249,
+- SDLK_WORLD_90 = 250,
+- SDLK_WORLD_91 = 251,
+- SDLK_WORLD_92 = 252,
+- SDLK_WORLD_93 = 253,
+- SDLK_WORLD_94 = 254,
+- SDLK_WORLD_95 = 255, /* 0xFF */
+-
+- /* Numeric keypad */
+- SDLK_KP0 = 256,
+- SDLK_KP1 = 257,
+- SDLK_KP2 = 258,
+- SDLK_KP3 = 259,
+- SDLK_KP4 = 260,
+- SDLK_KP5 = 261,
+- SDLK_KP6 = 262,
+- SDLK_KP7 = 263,
+- SDLK_KP8 = 264,
+- SDLK_KP9 = 265,
+- SDLK_KP_PERIOD = 266,
+- SDLK_KP_DIVIDE = 267,
+- SDLK_KP_MULTIPLY = 268,
+- SDLK_KP_MINUS = 269,
+- SDLK_KP_PLUS = 270,
+- SDLK_KP_ENTER = 271,
+- SDLK_KP_EQUALS = 272,
+-
+- /* Arrows + Home/End pad */
+- SDLK_UP = 273,
+- SDLK_DOWN = 274,
+- SDLK_RIGHT = 275,
+- SDLK_LEFT = 276,
+- SDLK_INSERT = 277,
+- SDLK_HOME = 278,
+- SDLK_END = 279,
+- SDLK_PAGEUP = 280,
+- SDLK_PAGEDOWN = 281,
+-
+- /* Function keys */
+- SDLK_F1 = 282,
+- SDLK_F2 = 283,
+- SDLK_F3 = 284,
+- SDLK_F4 = 285,
+- SDLK_F5 = 286,
+- SDLK_F6 = 287,
+- SDLK_F7 = 288,
+- SDLK_F8 = 289,
+- SDLK_F9 = 290,
+- SDLK_F10 = 291,
+- SDLK_F11 = 292,
+- SDLK_F12 = 293,
+- SDLK_F13 = 294,
+- SDLK_F14 = 295,
+- SDLK_F15 = 296,
+-
+- /* Key state modifier keys */
+- SDLK_NUMLOCK = 300,
+- SDLK_CAPSLOCK = 301,
+- SDLK_SCROLLOCK = 302,
+- SDLK_RSHIFT = 303,
+- SDLK_LSHIFT = 304,
+- SDLK_RCTRL = 305,
+- SDLK_LCTRL = 306,
+- SDLK_RALT = 307,
+- SDLK_LALT = 308,
+- SDLK_RMETA = 309,
+- SDLK_LMETA = 310,
+- SDLK_LSUPER = 311, /* Left "Windows" key */
+- SDLK_RSUPER = 312, /* Right "Windows" key */
+- SDLK_MODE = 313, /* "Alt Gr" key */
+- SDLK_COMPOSE = 314, /* Multi-key compose key */
+-
+- /* Miscellaneous function keys */
+- SDLK_HELP = 315,
+- SDLK_PRINT = 316,
+- SDLK_SYSREQ = 317,
+- SDLK_BREAK = 318,
+- SDLK_MENU = 319,
+- SDLK_POWER = 320, /* Power Macintosh power key */
+- SDLK_EURO = 321, /* Some european keyboards */
+- SDLK_UNDO = 322, /* Atari keyboard has Undo */
+-
+- /* Add any other keys here */
+-
+- SDLK_LAST
+-}
+-
+-/* Enumeration of valid key mods (possibly OR'd together) */
+-alias int SDLMod;
+-enum {
+- KMOD_NONE = 0x0000,
+- KMOD_LSHIFT= 0x0001,
+- KMOD_RSHIFT= 0x0002,
+- KMOD_LCTRL = 0x0040,
+- KMOD_RCTRL = 0x0080,
+- KMOD_LALT = 0x0100,
+- KMOD_RALT = 0x0200,
+- KMOD_LMETA = 0x0400,
+- KMOD_RMETA = 0x0800,
+- KMOD_NUM = 0x1000,
+- KMOD_CAPS = 0x2000,
+- KMOD_MODE = 0x4000,
+- KMOD_RESERVED = 0x8000
+-}
+-
+-const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL);
+-const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT);
+-const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT);
+-const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA);
+diff -Naur a2k-org/a2k_src/import/SDL_Keysym.d a2k/a2k_src/import/SDL_Keysym.d
+--- a2k-org/a2k_src/import/SDL_Keysym.d 1970-01-01 01:00:00.000000000 +0100
++++ a2k/a2k_src/import/SDL_Keysym.d 2008-10-07 10:47:18.000000000 +0200
+@@ -0,0 +1,308 @@
++/*
++ SDL - Simple DirectMedia Layer
++ Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
++
++ This library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Library General Public
++ License as published by the Free Software Foundation; either
++ version 2 of the License, or (at your option) any later version.
++
++ This library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this library; if not, write to the Free
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++
++ Sam Lantinga
++ slouken@devolution.com
++*/
++
++/* What we really want is a mapping of every raw key on the keyboard.
++ To support international keyboards, we use the range 0xA1 - 0xFF
++ as international virtual keycodes. We'll follow in the footsteps of X11...
++ The names of the keys
++ */
++
++alias int SDLKey;
++enum {
++ /* The keyboard syms have been cleverly chosen to map to ASCII */
++ SDLK_UNKNOWN = 0,
++ SDLK_FIRST = 0,
++ SDLK_BACKSPACE = 8,
++ SDLK_TAB = 9,
++ SDLK_CLEAR = 12,
++ SDLK_RETURN = 13,
++ SDLK_PAUSE = 19,
++ SDLK_ESCAPE = 27,
++ SDLK_SPACE = 32,
++ SDLK_EXCLAIM = 33,
++ SDLK_QUOTEDBL = 34,
++ SDLK_HASH = 35,
++ SDLK_DOLLAR = 36,
++ SDLK_AMPERSAND = 38,
++ SDLK_QUOTE = 39,
++ SDLK_LEFTPAREN = 40,
++ SDLK_RIGHTPAREN = 41,
++ SDLK_ASTERISK = 42,
++ SDLK_PLUS = 43,
++ SDLK_COMMA = 44,
++ SDLK_MINUS = 45,
++ SDLK_PERIOD = 46,
++ SDLK_SLASH = 47,
++ SDLK_0 = 48,
++ SDLK_1 = 49,
++ SDLK_2 = 50,
++ SDLK_3 = 51,
++ SDLK_4 = 52,
++ SDLK_5 = 53,
++ SDLK_6 = 54,
++ SDLK_7 = 55,
++ SDLK_8 = 56,
++ SDLK_9 = 57,
++ SDLK_COLON = 58,
++ SDLK_SEMICOLON = 59,
++ SDLK_LESS = 60,
++ SDLK_EQUALS = 61,
++ SDLK_GREATER = 62,
++ SDLK_QUESTION = 63,
++ SDLK_AT = 64,
++ /*
++ Skip uppercase letters
++ */
++ SDLK_LEFTBRACKET = 91,
++ SDLK_BACKSLASH = 92,
++ SDLK_RIGHTBRACKET = 93,
++ SDLK_CARET = 94,
++ SDLK_UNDERSCORE = 95,
++ SDLK_BACKQUOTE = 96,
++ SDLK_a = 97,
++ SDLK_b = 98,
++ SDLK_c = 99,
++ SDLK_d = 100,
++ SDLK_e = 101,
++ SDLK_f = 102,
++ SDLK_g = 103,
++ SDLK_h = 104,
++ SDLK_i = 105,
++ SDLK_j = 106,
++ SDLK_k = 107,
++ SDLK_l = 108,
++ SDLK_m = 109,
++ SDLK_n = 110,
++ SDLK_o = 111,
++ SDLK_p = 112,
++ SDLK_q = 113,
++ SDLK_r = 114,
++ SDLK_s = 115,
++ SDLK_t = 116,
++ SDLK_u = 117,
++ SDLK_v = 118,
++ SDLK_w = 119,
++ SDLK_x = 120,
++ SDLK_y = 121,
++ SDLK_z = 122,
++ SDLK_DELETE = 127,
++ /* End of ASCII mapped keysyms */
++
++ /* International keyboard syms */
++ SDLK_WORLD_0 = 160, /* 0xA0 */
++ SDLK_WORLD_1 = 161,
++ SDLK_WORLD_2 = 162,
++ SDLK_WORLD_3 = 163,
++ SDLK_WORLD_4 = 164,
++ SDLK_WORLD_5 = 165,
++ SDLK_WORLD_6 = 166,
++ SDLK_WORLD_7 = 167,
++ SDLK_WORLD_8 = 168,
++ SDLK_WORLD_9 = 169,
++ SDLK_WORLD_10 = 170,
++ SDLK_WORLD_11 = 171,
++ SDLK_WORLD_12 = 172,
++ SDLK_WORLD_13 = 173,
++ SDLK_WORLD_14 = 174,
++ SDLK_WORLD_15 = 175,
++ SDLK_WORLD_16 = 176,
++ SDLK_WORLD_17 = 177,
++ SDLK_WORLD_18 = 178,
++ SDLK_WORLD_19 = 179,
++ SDLK_WORLD_20 = 180,
++ SDLK_WORLD_21 = 181,
++ SDLK_WORLD_22 = 182,
++ SDLK_WORLD_23 = 183,
++ SDLK_WORLD_24 = 184,
++ SDLK_WORLD_25 = 185,
++ SDLK_WORLD_26 = 186,
++ SDLK_WORLD_27 = 187,
++ SDLK_WORLD_28 = 188,
++ SDLK_WORLD_29 = 189,
++ SDLK_WORLD_30 = 190,
++ SDLK_WORLD_31 = 191,
++ SDLK_WORLD_32 = 192,
++ SDLK_WORLD_33 = 193,
++ SDLK_WORLD_34 = 194,
++ SDLK_WORLD_35 = 195,
++ SDLK_WORLD_36 = 196,
++ SDLK_WORLD_37 = 197,
++ SDLK_WORLD_38 = 198,
++ SDLK_WORLD_39 = 199,
++ SDLK_WORLD_40 = 200,
++ SDLK_WORLD_41 = 201,
++ SDLK_WORLD_42 = 202,
++ SDLK_WORLD_43 = 203,
++ SDLK_WORLD_44 = 204,
++ SDLK_WORLD_45 = 205,
++ SDLK_WORLD_46 = 206,
++ SDLK_WORLD_47 = 207,
++ SDLK_WORLD_48 = 208,
++ SDLK_WORLD_49 = 209,
++ SDLK_WORLD_50 = 210,
++ SDLK_WORLD_51 = 211,
++ SDLK_WORLD_52 = 212,
++ SDLK_WORLD_53 = 213,
++ SDLK_WORLD_54 = 214,
++ SDLK_WORLD_55 = 215,
++ SDLK_WORLD_56 = 216,
++ SDLK_WORLD_57 = 217,
++ SDLK_WORLD_58 = 218,
++ SDLK_WORLD_59 = 219,
++ SDLK_WORLD_60 = 220,
++ SDLK_WORLD_61 = 221,
++ SDLK_WORLD_62 = 222,
++ SDLK_WORLD_63 = 223,
++ SDLK_WORLD_64 = 224,
++ SDLK_WORLD_65 = 225,
++ SDLK_WORLD_66 = 226,
++ SDLK_WORLD_67 = 227,
++ SDLK_WORLD_68 = 228,
++ SDLK_WORLD_69 = 229,
++ SDLK_WORLD_70 = 230,
++ SDLK_WORLD_71 = 231,
++ SDLK_WORLD_72 = 232,
++ SDLK_WORLD_73 = 233,
++ SDLK_WORLD_74 = 234,
++ SDLK_WORLD_75 = 235,
++ SDLK_WORLD_76 = 236,
++ SDLK_WORLD_77 = 237,
++ SDLK_WORLD_78 = 238,
++ SDLK_WORLD_79 = 239,
++ SDLK_WORLD_80 = 240,
++ SDLK_WORLD_81 = 241,
++ SDLK_WORLD_82 = 242,
++ SDLK_WORLD_83 = 243,
++ SDLK_WORLD_84 = 244,
++ SDLK_WORLD_85 = 245,
++ SDLK_WORLD_86 = 246,
++ SDLK_WORLD_87 = 247,
++ SDLK_WORLD_88 = 248,
++ SDLK_WORLD_89 = 249,
++ SDLK_WORLD_90 = 250,
++ SDLK_WORLD_91 = 251,
++ SDLK_WORLD_92 = 252,
++ SDLK_WORLD_93 = 253,
++ SDLK_WORLD_94 = 254,
++ SDLK_WORLD_95 = 255, /* 0xFF */
++
++ /* Numeric keypad */
++ SDLK_KP0 = 256,
++ SDLK_KP1 = 257,
++ SDLK_KP2 = 258,
++ SDLK_KP3 = 259,
++ SDLK_KP4 = 260,
++ SDLK_KP5 = 261,
++ SDLK_KP6 = 262,
++ SDLK_KP7 = 263,
++ SDLK_KP8 = 264,
++ SDLK_KP9 = 265,
++ SDLK_KP_PERIOD = 266,
++ SDLK_KP_DIVIDE = 267,
++ SDLK_KP_MULTIPLY = 268,
++ SDLK_KP_MINUS = 269,
++ SDLK_KP_PLUS = 270,
++ SDLK_KP_ENTER = 271,
++ SDLK_KP_EQUALS = 272,
++
++ /* Arrows + Home/End pad */
++ SDLK_UP = 273,
++ SDLK_DOWN = 274,
++ SDLK_RIGHT = 275,
++ SDLK_LEFT = 276,
++ SDLK_INSERT = 277,
++ SDLK_HOME = 278,
++ SDLK_END = 279,
++ SDLK_PAGEUP = 280,
++ SDLK_PAGEDOWN = 281,
++
++ /* Function keys */
++ SDLK_F1 = 282,
++ SDLK_F2 = 283,
++ SDLK_F3 = 284,
++ SDLK_F4 = 285,
++ SDLK_F5 = 286,
++ SDLK_F6 = 287,
++ SDLK_F7 = 288,
++ SDLK_F8 = 289,
++ SDLK_F9 = 290,
++ SDLK_F10 = 291,
++ SDLK_F11 = 292,
++ SDLK_F12 = 293,
++ SDLK_F13 = 294,
++ SDLK_F14 = 295,
++ SDLK_F15 = 296,
++
++ /* Key state modifier keys */
++ SDLK_NUMLOCK = 300,
++ SDLK_CAPSLOCK = 301,
++ SDLK_SCROLLOCK = 302,
++ SDLK_RSHIFT = 303,
++ SDLK_LSHIFT = 304,
++ SDLK_RCTRL = 305,
++ SDLK_LCTRL = 306,
++ SDLK_RALT = 307,
++ SDLK_LALT = 308,
++ SDLK_RMETA = 309,
++ SDLK_LMETA = 310,
++ SDLK_LSUPER = 311, /* Left "Windows" key */
++ SDLK_RSUPER = 312, /* Right "Windows" key */
++ SDLK_MODE = 313, /* "Alt Gr" key */
++ SDLK_COMPOSE = 314, /* Multi-key compose key */
++
++ /* Miscellaneous function keys */
++ SDLK_HELP = 315,
++ SDLK_PRINT = 316,
++ SDLK_SYSREQ = 317,
++ SDLK_BREAK = 318,
++ SDLK_MENU = 319,
++ SDLK_POWER = 320, /* Power Macintosh power key */
++ SDLK_EURO = 321, /* Some european keyboards */
++ SDLK_UNDO = 322, /* Atari keyboard has Undo */
++
++ /* Add any other keys here */
++
++ SDLK_LAST
++}
++
++/* Enumeration of valid key mods (possibly OR'd together) */
++alias int SDLMod;
++enum {
++ KMOD_NONE = 0x0000,
++ KMOD_LSHIFT= 0x0001,
++ KMOD_RSHIFT= 0x0002,
++ KMOD_LCTRL = 0x0040,
++ KMOD_RCTRL = 0x0080,
++ KMOD_LALT = 0x0100,
++ KMOD_RALT = 0x0200,
++ KMOD_LMETA = 0x0400,
++ KMOD_RMETA = 0x0800,
++ KMOD_NUM = 0x1000,
++ KMOD_CAPS = 0x2000,
++ KMOD_MODE = 0x4000,
++ KMOD_RESERVED = 0x8000
++}
++
++const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL);
++const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT);
++const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT);
++const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA);
+diff -Naur a2k-org/a2k_src/import/SDL_mixer.d a2k/a2k_src/import/SDL_mixer.d
+--- a2k-org/a2k_src/import/SDL_mixer.d 2006-07-26 23:24:04.000000000 +0200
++++ a2k/a2k_src/import/SDL_mixer.d 2004-05-08 14:09:18.000000000 +0200
+@@ -24,7 +24,7 @@
+
+ /* $Id: SDL_mixer.h,v 1.24 2002/05/21 05:45:59 slouken Exp $ */
+
+-public import SDL;
++import SDL;
+
+ extern (C) {
+
+diff -Naur a2k-org/a2k_src/import/SDL_mouse.d a2k/a2k_src/import/SDL_mouse.d
+--- a2k-org/a2k_src/import/SDL_mouse.d 2006-07-26 23:25:18.000000000 +0200
++++ a2k/a2k_src/import/SDL_mouse.d 2004-05-08 12:50:44.000000000 +0200
+@@ -22,8 +22,8 @@
+
+ /* Include file for SDL mouse event handling */
+
+-public import SDL_types;
+-public import SDL_video;
++import SDL_types;
++import SDL_video;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_mutex.d a2k/a2k_src/import/SDL_mutex.d
+--- a2k-org/a2k_src/import/SDL_mutex.d 2006-07-26 23:25:20.000000000 +0200
++++ a2k/a2k_src/import/SDL_mutex.d 2002-01-04 15:36:58.000000000 +0100
+@@ -25,7 +25,7 @@
+ These are independent of the other SDL routines.
+ */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_quit.d a2k/a2k_src/import/SDL_quit.d
+--- a2k-org/a2k_src/import/SDL_quit.d 2006-07-26 23:25:22.000000000 +0200
++++ a2k/a2k_src/import/SDL_quit.d 2003-12-04 04:03:56.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ /* Include file for SDL quit event handling */
+
+-public import SDL_events;
++import SDL_events;
+
+ /*
+ An SDL_QUITEVENT is generated when the user tries to close the application
+diff -Naur a2k-org/a2k_src/import/SDL_rwops.d a2k/a2k_src/import/SDL_rwops.d
+--- a2k-org/a2k_src/import/SDL_rwops.d 2006-07-26 23:25:24.000000000 +0200
++++ a2k/a2k_src/import/SDL_rwops.d 2003-12-04 04:11:24.000000000 +0100
+@@ -24,7 +24,7 @@
+ data sources. It can easily be extended to files, memory, etc.
+ */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_sound.d a2k/a2k_src/import/SDL_sound.d
+--- a2k-org/a2k_src/import/SDL_sound.d 2006-07-26 23:25:26.000000000 +0200
++++ a2k/a2k_src/import/SDL_sound.d 2004-05-08 14:09:58.000000000 +0200
+@@ -62,7 +62,7 @@
+
+ // convert to D by shinichiro.h
+
+-public import SDL;
++import SDL;
+
+ extern (C) {
+ const int SOUND_VER_MAJOR = 1;
+diff -Naur a2k-org/a2k_src/import/SDL_syswm.d a2k/a2k_src/import/SDL_syswm.d
+--- a2k-org/a2k_src/import/SDL_syswm.d 2006-07-26 23:25:32.000000000 +0200
++++ a2k/a2k_src/import/SDL_syswm.d 2004-01-03 16:10:50.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ /* Include file for SDL custom system window manager hooks */
+
+-public import SDL_Version;
++import SDL_Version;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_thread.d a2k/a2k_src/import/SDL_thread.d
+--- a2k-org/a2k_src/import/SDL_thread.d 2006-07-26 23:25:36.000000000 +0200
++++ a2k/a2k_src/import/SDL_thread.d 2002-01-04 15:40:06.000000000 +0100
+@@ -25,8 +25,8 @@
+ These are independent of the other SDL routines.
+ */
+
+-public import SDL_types;
+-public import SDL_mutex;
++import SDL_types;
++import SDL_mutex;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_timer.d a2k/a2k_src/import/SDL_timer.d
+--- a2k-org/a2k_src/import/SDL_timer.d 2006-07-26 23:25:38.000000000 +0200
++++ a2k/a2k_src/import/SDL_timer.d 2002-01-04 15:21:04.000000000 +0100
+@@ -20,7 +20,7 @@
+ slouken@devolution.com
+ */
+
+-public import SDL_types;
++import SDL_types;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/import/SDL_version.d a2k/a2k_src/import/SDL_version.d
+--- a2k-org/a2k_src/import/SDL_version.d 2006-07-26 23:25:40.000000000 +0200
++++ a2k/a2k_src/import/SDL_version.d 1970-01-01 01:00:00.000000000 +0100
+@@ -1,75 +0,0 @@
+-/*
+- SDL - Simple DirectMedia Layer
+- Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
+-
+- This library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Library General Public
+- License as published by the Free Software Foundation; either
+- version 2 of the License, or (at your option) any later version.
+-
+- This library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Library General Public License for more details.
+-
+- You should have received a copy of the GNU Library General Public
+- License along with this library; if not, write to the Free
+- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-
+- Sam Lantinga
+- slouken@devolution.com
+-*/
+-
+-/* This header defines the current SDL version */
+-
+-public import SDL_types;
+-
+-extern(C):
+-
+-/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+-*/
+-const uint SDL_MAJOR_VERSION = 1;
+-const uint SDL_MINOR_VERSION = 2;
+-const uint SDL_PATCHLEVEL = 6;
+-
+-struct SDL_version {
+- Uint8 major;
+- Uint8 minor;
+- Uint8 patch;
+-}
+-
+-/* This macro can be used to fill a version structure with the compile-time
+- * version of the SDL library.
+- */
+-void SDL_VERSION(SDL_version* X)
+-{
+- X.major = SDL_MAJOR_VERSION;
+- X.minor = SDL_MINOR_VERSION;
+- X.patch = SDL_PATCHLEVEL;
+-}
+-
+-/* This macro turns the version numbers into a numeric value:
+- (1,2,3) -> (1203)
+- This assumes that there will never be more than 100 patchlevels
+-*/
+-uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z)
+-{
+- return X * 1000 + Y * 100 + Z;
+-}
+-
+-/* This is the version number macro for the current SDL version */
+-const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 +
+- SDL_MINOR_VERSION * 100 +
+- SDL_PATCHLEVEL;
+-
+-/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
+-bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
+-{
+- return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
+-}
+-
+-/* This function gets the version of the dynamically linked SDL library.
+- it should NOT be used to fill a version structure, instead you should
+- use the SDL_Version() macro.
+- */
+-SDL_version * SDL_Linked_Version();
+diff -Naur a2k-org/a2k_src/import/SDL_Version.d a2k/a2k_src/import/SDL_Version.d
+--- a2k-org/a2k_src/import/SDL_Version.d 1970-01-01 01:00:00.000000000 +0100
++++ a2k/a2k_src/import/SDL_Version.d 2008-10-07 10:47:18.000000000 +0200
+@@ -0,0 +1,75 @@
++/*
++ SDL - Simple DirectMedia Layer
++ Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
++
++ This library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Library General Public
++ License as published by the Free Software Foundation; either
++ version 2 of the License, or (at your option) any later version.
++
++ This library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this library; if not, write to the Free
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++
++ Sam Lantinga
++ slouken@devolution.com
++*/
++
++/* This header defines the current SDL version */
++
++import SDL_types;
++
++extern(C):
++
++/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
++*/
++const uint SDL_MAJOR_VERSION = 1;
++const uint SDL_MINOR_VERSION = 2;
++const uint SDL_PATCHLEVEL = 6;
++
++struct SDL_version {
++ Uint8 major;
++ Uint8 minor;
++ Uint8 patch;
++}
++
++/* This macro can be used to fill a version structure with the compile-time
++ * version of the SDL library.
++ */
++void SDL_VERSION(SDL_version* X)
++{
++ X.major = SDL_MAJOR_VERSION;
++ X.minor = SDL_MINOR_VERSION;
++ X.patch = SDL_PATCHLEVEL;
++}
++
++/* This macro turns the version numbers into a numeric value:
++ (1,2,3) -> (1203)
++ This assumes that there will never be more than 100 patchlevels
++*/
++uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z)
++{
++ return X * 1000 + Y * 100 + Z;
++}
++
++/* This is the version number macro for the current SDL version */
++const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 +
++ SDL_MINOR_VERSION * 100 +
++ SDL_PATCHLEVEL;
++
++/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
++bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
++{
++ return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
++}
++
++/* This function gets the version of the dynamically linked SDL library.
++ it should NOT be used to fill a version structure, instead you should
++ use the SDL_Version() macro.
++ */
++SDL_version * SDL_Linked_Version();
+diff -Naur a2k-org/a2k_src/import/SDL_video.d a2k/a2k_src/import/SDL_video.d
+--- a2k-org/a2k_src/import/SDL_video.d 2006-07-26 23:25:42.000000000 +0200
++++ a2k/a2k_src/import/SDL_video.d 2002-05-22 07:45:40.000000000 +0200
+@@ -22,9 +22,9 @@
+
+ /* Header file for access to the SDL raw framebuffer window */
+
+-public import SDL_types;
+-public import SDL_mutex;
+-public import SDL_rwops;
++import SDL_types;
++import SDL_mutex;
++import SDL_rwops;
+
+ extern(C):
+
+diff -Naur a2k-org/a2k_src/src/bg.d a2k/a2k_src/src/bg.d
+--- a2k-org/a2k_src/src/bg.d 2005-01-18 00:34:48.000000000 +0100
++++ a2k/a2k_src/src/bg.d 2008-10-07 09:53:28.000000000 +0200
+@@ -14,7 +14,12 @@
+ private import util_snd;
+ private import define;
+ private import task;
+-private import stg;
++private import stg;
++private import stg01;
++private import stg02;
++private import stg03;
++private import stg04;
++private import stg05;
+ private import effect;
+ private import ship;
+
+@@ -79,20 +84,20 @@
+ TskBuf[fade_id].tx = 1.0f;
+ TskBuf[fade_id].wait = 60;
+ TskBuf[fade_id].step = 2;
+- TskBuf[id].px = cast(float)(rand() % 1536 - 768.0f);
++ TskBuf[id].px = cast(float)(rand() % 1536 - 768.0f);
+ TskBuf[id].py = cast(float)(rand() % 1536 - 768.0f);
+ if((rand() % 100) & 0x01){
+ if(TskBuf[id].px < 0.0f){
+ TskBuf[id].tx = +(cast(float)(rand() % 768));
+ }else{
+- TskBuf[id].tx = -(cast(float)(rand() % 768));
++ TskBuf[id].tx = +(cast(float)(rand() % 768));
+ }
+ TskBuf[id].ty = TskBuf[id].py;
+ }else{
+ if(TskBuf[id].py < 0.0f){
+ TskBuf[id].ty = +(cast(float)(rand() % 768));
+ }else{
+- TskBuf[id].ty = -(cast(float)(rand() % 768));
++ TskBuf[id].ty = +(cast(float)(rand() % 768));
+ }
+ TskBuf[id].tx = TskBuf[id].px;
+ }
+@@ -104,7 +109,7 @@
+ cam_pos = BASE_Z + cam_scr;
+ eid = setTSK(GROUP_08,&TSKbgZoom);
+ TskBuf[eid].wait = 600;
+- TskBuf[eid].tx = BASE_Z - (cast(float)((rand() % 5000) - 2500 + 10000) / 10000.0f);
++ TskBuf[eid].tx = BASE_Z - ((cast(float)(rand() % 5000) - 2500 + 10000) / 10000.0f);
+ TskBuf[id].step++;
+ break;
+ case 2:
+@@ -202,22 +207,34 @@
+ scr_base[Y] = START_Y;
+ scr_ofs[X] = 0.0f;
+ scr_ofs[Y] = 0.0f;
+- cam_pos = BASE_Z + cam_scr;
++ cam_pos = BASE_Z + cam_scr;
++ bg_mode = 0;
++ stg_ctrl = STG_MAIN;
+ switch(area_num){
+ case AREA_01:
+- bg_mode = 0;
++ bg_mode = 0;
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg01);
+ break;
+ case AREA_02:
+- bg_mode = 1;
++ bg_mode = 1;
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg02);
+ break;
+ case AREA_03:
+- bg_mode = 2;
++ bg_mode = 2;
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg03);
+ break;
+ case AREA_04:
+- bg_mode = 3;
++ bg_mode = 3;
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg04);
+ break;
+ case AREA_05:
+- bg_mode = 4;
++ bg_mode = 4;
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg05);
+ break;
+ default:
+ break;
+@@ -296,7 +313,7 @@
+ bg_obj[i].line_list.length = 1;
+ bg_obj[i].line_list[0][X] = +0.0f;
+ bg_obj[i].line_list[0][Y] = +0.0f;
+- bg_obj[i].line_list[0][Z] = -(cast(float)(rand() % 75)) / 100.0f + 0.25f;
++ bg_obj[i].line_list[0][Z] = -cast(float)(rand() % 75) / 100.0f + 0.25f;
+ }
+ break;
+ case 4:
+@@ -600,8 +617,8 @@
+ break;
+ case 1:
+ if(TskBuf[id].wait){
+- TskBuf[id].px = ((rand() % (256.0f * TskBuf[id].vx)) - ((256.0f * TskBuf[id].vx) / 2)) / 256.0f;
+- TskBuf[id].py = ((rand() % (256.0f * TskBuf[id].vy)) - ((256.0f * TskBuf[id].vy) / 2)) / 256.0f;
++ TskBuf[id].px = (cast(float)(rand() % (256.0f * TskBuf[id].vx)) - ((256.0f * TskBuf[id].vx) / 2)) / 256.0f;
++ TskBuf[id].py = (cast(float)(rand() % (256.0f * TskBuf[id].vy)) - ((256.0f * TskBuf[id].vy) / 2)) / 256.0f;
+ TskBuf[id].vx += (0.0f - TskBuf[id].vx) / TskBuf[id].cnt;
+ TskBuf[id].vy += (0.0f - TskBuf[id].vy) / TskBuf[id].cnt;
+ scr_ofs[X] = TskBuf[id].px;
+diff -Naur a2k-org/a2k_src/src/boss01.d a2k/a2k_src/src/boss01.d
+--- a2k-org/a2k_src/src/boss01.d 2008-02-06 01:34:54.000000000 +0100
++++ a2k/a2k_src/src/boss01.d 2008-10-07 09:57:49.000000000 +0200
+@@ -7,7 +7,7 @@
+ */
+
+ private import std.stdio;
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/boss02.d a2k/a2k_src/src/boss02.d
+--- a2k-org/a2k_src/src/boss02.d 2008-02-06 01:35:18.000000000 +0100
++++ a2k/a2k_src/src/boss02.d 2008-10-07 09:58:18.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/16 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/boss03.d a2k/a2k_src/src/boss03.d
+--- a2k-org/a2k_src/src/boss03.d 2008-02-06 01:35:30.000000000 +0100
++++ a2k/a2k_src/src/boss03.d 2008-10-07 09:58:28.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/08 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+@@ -358,7 +358,7 @@
+ }
+ if(!cmd.isEnd()) cmd.run();
+ break;
+- TskBuf[id].ang_x = rand() % 65536;
++ TskBuf[id].ang_x = cast(float)rand() % 65536;
+ TskBuf[id].ang_x *= PI / 65536.0f;
+ TskBuf[id].ax =
+ TskBuf[id].ay = sin(TskBuf[id].ang_x) * 5.0f / PI;
+diff -Naur a2k-org/a2k_src/src/boss04.d a2k/a2k_src/src/boss04.d
+--- a2k-org/a2k_src/src/boss04.d 2008-02-06 01:35:34.000000000 +0100
++++ a2k/a2k_src/src/boss04.d 2008-10-07 09:58:35.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/06 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/boss05.d a2k/a2k_src/src/boss05.d
+--- a2k-org/a2k_src/src/boss05.d 2008-02-06 01:35:38.000000000 +0100
++++ a2k/a2k_src/src/boss05.d 2008-10-07 09:58:43.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/09 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/bulletcommand.d a2k/a2k_src/src/bulletcommand.d
+--- a2k-org/a2k_src/src/bulletcommand.d 2008-02-06 01:37:56.000000000 +0100
++++ a2k/a2k_src/src/bulletcommand.d 2008-10-07 09:53:28.000000000 +0200
+@@ -247,7 +247,7 @@
+ double getRand_(BulletMLRunner* runner){
+ double rand_val;
+ //printf("getRand_(%d)\n",BulletCommand.now.id);
+- rand_val = rand() % 10000;
++ rand_val = cast(float)rand() % 10000;
+ rand_val /= 10000;
+ return rand_val;
+ }
+diff -Naur a2k-org/a2k_src/src/effect.d a2k/a2k_src/src/effect.d
+--- a2k-org/a2k_src/src/effect.d 2008-02-06 01:35:40.000000000 +0100
++++ a2k/a2k_src/src/effect.d 2008-10-07 10:03:12.000000000 +0200
+@@ -6,14 +6,15 @@
+ 2004/03/31 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+ private import opengl;
+ private import util_sdl;
+ private import task;
+-private import bg;
++private import bg;
++private import system;
+
+ float fade_r = 0.0f;
+ float fade_g = 0.0f;
+@@ -53,16 +54,16 @@
+ for(int i = 0; i < 3; i++){
+ switch(i){
+ case 0:
+- tpos[X] = -((rand() % 4096) / 1024.0f + 1.0f);
+- tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
++ tpos[X] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
++ tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
+ break;
+ case 1:
+- tpos[X] = ((rand() % 2048) / 1024.0f - 1.0f);
+- tpos[Y] = -((rand() % 4096) / 1024.0f + 1.0f);
++ tpos[X] = cast(float)((rand() % 2048) / 1024.0f - 1.0f);
++ tpos[Y] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f);
+ break;
+ case 2:
+- tpos[X] = +((rand() % 4096) / 1024.0f + 1.0f);
+- tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f);
++ tpos[X] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
++ tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f);
+ break;
+ default:
+ break;
+@@ -74,8 +75,8 @@
+ tpos[Y] = fabs(tpos[Y]);
+ TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
+ }
+- TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
+- TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
+ TskBuf[id].tx += TskBuf[id].px;
+ TskBuf[id].ty += TskBuf[id].py;
+ TskBuf[id].wait = 60;
+@@ -165,16 +166,16 @@
+ for(int i = 0; i < 3; i++){
+ switch(i){
+ case 0:
+- tpos[X] = -((rand() % 12288) / 1024.0f + 3.0f);
+- tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
++ tpos[X] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
++ tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
+ break;
+ case 1:
+- tpos[X] = ((rand() % 6144) / 1024.0f - 3.0f);
+- tpos[Y] = -((rand() % 12288) / 1024.0f + 3.0f);
++ tpos[X] = (cast(float)(rand() % 6144) / 1024.0f - 3.0f);
++ tpos[Y] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
+ break;
+ case 2:
+- tpos[X] = +((rand() % 12288) / 1024.0f + 3.0f);
+- tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f);
++ tpos[X] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
++ tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f);
+ break;
+ default:
+ break;
+@@ -186,8 +187,8 @@
+ tpos[Y] = fabs(tpos[Y]);
+ TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0));
+ }
+- TskBuf[id].tx = (rand() % 512000) / 1000.0f - 256.0f;
+- TskBuf[id].ty = (rand() % 512000) / 1000.0f - 256.0f;
++ TskBuf[id].tx = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
++ TskBuf[id].ty = cast(float)(rand() % 512000) / 1000.0f - 256.0f;
+ TskBuf[id].tx += TskBuf[id].px;
+ TskBuf[id].ty += TskBuf[id].py;
+ TskBuf[id].wait = 60;
+@@ -279,13 +280,13 @@
+ TskBuf[id].fp_draw = &TSKBrokenBodyDraw;
+ TskBuf[id].fp_exit = &TSKBrokenBodyExit;
+ TskBuf[id].alpha = 1.0f;
+- TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
+- TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
+ TskBuf[id].tx *= 2.0f;
+ TskBuf[id].ty *= 2.0f;
+ TskBuf[id].tx += TskBuf[id].px;
+ TskBuf[id].ty += TskBuf[id].py;
+- TskBuf[id].rot_add = (rand % 30) - 15;
++ TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
+ if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1;
+ else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
+ if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
+@@ -410,13 +411,13 @@
+ TskBuf[id].fp_draw = &TSKBrokenLineDraw;
+ TskBuf[id].fp_exit = &TSKBrokenLineExit;
+ TskBuf[id].alpha = 1.0f;
+- TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f;
+- TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
++ TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f;
+ TskBuf[id].tx *= 2.0f;
+ TskBuf[id].ty *= 2.0f;
+ TskBuf[id].tx += TskBuf[id].px;
+ TskBuf[id].ty += TskBuf[id].py;
+- TskBuf[id].rot_add = (rand % 30) - 15;
++ TskBuf[id].rot_add = cast(float)(rand % 30) - 15;
+ if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1;
+ else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1;
+ if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15);
+diff -Naur a2k-org/a2k_src/src/enemy01.d a2k/a2k_src/src/enemy01.d
+--- a2k-org/a2k_src/src/enemy01.d 2008-02-06 01:35:46.000000000 +0100
++++ a2k/a2k_src/src/enemy01.d 2008-10-07 10:03:51.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/03/27 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -63,8 +63,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy01Draw;
+ TskBuf[id].fp_exit = &TSKenemy01Exit;
+diff -Naur a2k-org/a2k_src/src/enemy02.d a2k/a2k_src/src/enemy02.d
+--- a2k-org/a2k_src/src/enemy02.d 2008-02-06 01:35:48.000000000 +0100
++++ a2k/a2k_src/src/enemy02.d 2008-10-07 10:04:05.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/11 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -63,8 +63,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy02Draw;
+ TskBuf[id].fp_exit = &TSKenemy02Exit;
+diff -Naur a2k-org/a2k_src/src/enemy03.d a2k/a2k_src/src/enemy03.d
+--- a2k-org/a2k_src/src/enemy03.d 2008-02-06 01:35:52.000000000 +0100
++++ a2k/a2k_src/src/enemy03.d 2008-10-07 10:04:19.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/11 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -63,8 +63,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy03Draw;
+diff -Naur a2k-org/a2k_src/src/enemy04.d a2k/a2k_src/src/enemy04.d
+--- a2k-org/a2k_src/src/enemy04.d 2008-02-06 01:35:56.000000000 +0100
++++ a2k/a2k_src/src/enemy04.d 2008-10-07 10:05:41.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/11 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -53,8 +53,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy04Draw;
+@@ -132,14 +132,14 @@
+ TskBuf[id].vx = TskBuf[id].px;
+ TskBuf[id].vy = TskBuf[id].py;
+ if(!TskBuf[id].cnt){
+- TskBuf[id].tx = (rand() % 512) + 256.0f;
+- TskBuf[id].ty = (rand() % 512) + 256.0f;
++ TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
++ TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
+ if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
+ else TskBuf[id].tx = -TskBuf[id].tx;
+ if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
+ else TskBuf[id].ty = -TskBuf[id].ty;
+- if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
+- if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
+ TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
+ TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
+ if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
+diff -Naur a2k-org/a2k_src/src/enemy05.d a2k/a2k_src/src/enemy05.d
+--- a2k-org/a2k_src/src/enemy05.d 2008-02-06 01:35:58.000000000 +0100
++++ a2k/a2k_src/src/enemy05.d 2008-10-07 10:08:43.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/05/30 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -53,8 +53,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy05Draw;
+@@ -127,42 +127,31 @@
+ }
+ }
+ /* 座標更新 */
+- if(TskBuf[id].px < ship_px){
+- if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
+- }else{
+- if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
+- }
+- if(TskBuf[id].py < ship_py){
+- if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
+- }else{
+- if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
+- }
+- TskBuf[id].px += TskBuf[id].vx;
+- TskBuf[id].py += TskBuf[id].vy;
+- if(TskBuf[id].px < -ENEMY_AREAMAX){
+- TskBuf[id].px = -ENEMY_AREAMAX;
+- TskBuf[id].vx = -TskBuf[id].vx / 2;
+- }
+- if(TskBuf[id].px > +ENEMY_AREAMAX){
+- TskBuf[id].px = +ENEMY_AREAMAX;
+- TskBuf[id].vx = -TskBuf[id].vx / 2;
+- }
+- if(TskBuf[id].py < -ENEMY_AREAMAX){
+- TskBuf[id].py = -ENEMY_AREAMAX;
+- TskBuf[id].vy = -TskBuf[id].vy / 2;
+- }
+- if(TskBuf[id].py > +ENEMY_AREAMAX){
+- TskBuf[id].py = +ENEMY_AREAMAX;
+- TskBuf[id].vy = -TskBuf[id].vy / 2;
+- }
++ TskBuf[id].vx = TskBuf[id].px;
++ TskBuf[id].vy = TskBuf[id].py;
++ if(!TskBuf[id].cnt){
++ TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
++ TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
++ if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
++ else TskBuf[id].tx = -TskBuf[id].tx;
++ if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
++ else TskBuf[id].ty = -TskBuf[id].ty;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
++ TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
++ TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
++ if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
++ if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
++ if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
++ if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
++ TskBuf[id].cnt = 180;
++ }else{
++ TskBuf[id].cnt--;
++ }
++ TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
++ TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
++ TskBuf[id].vx -= TskBuf[id].px;
++ TskBuf[id].vy -= TskBuf[id].py;
+ TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
+ break;
+ default:
+diff -Naur a2k-org/a2k_src/src/enemy06.d a2k/a2k_src/src/enemy06.d
+--- a2k-org/a2k_src/src/enemy06.d 2008-02-06 01:36:00.000000000 +0100
++++ a2k/a2k_src/src/enemy06.d 2008-10-07 10:10:11.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/04 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -65,8 +65,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy06Draw;
+@@ -145,14 +145,14 @@
+ TskBuf[id].vx = TskBuf[id].px;
+ TskBuf[id].vy = TskBuf[id].py;
+ if(TskBuf[id].cnt == TskBuf[id].mov_cnt){
+- TskBuf[id].tx = (rand() % 512) + 256.0f;
+- TskBuf[id].ty = (rand() % 512) + 256.0f;
++ TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
++ TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
+ if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
+ else TskBuf[id].tx = -TskBuf[id].tx;
+ if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
+ else TskBuf[id].ty = -TskBuf[id].ty;
+- if((rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
+- if((rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
+ TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
+ TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
+ if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
+diff -Naur a2k-org/a2k_src/src/enemy07.d a2k/a2k_src/src/enemy07.d
+--- a2k-org/a2k_src/src/enemy07.d 2008-02-06 01:36:02.000000000 +0100
++++ a2k/a2k_src/src/enemy07.d 2008-10-07 10:11:42.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/05 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -63,8 +63,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy07Draw;
+@@ -137,42 +137,31 @@
+ }
+ }
+ /* 座標更新 */
+- if(TskBuf[id].px < ship_px){
+- if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vx > +MAX_SPEED) TskBuf[id].vx = +MAX_SPEED;
+- }else{
+- if(TskBuf[id].vx < +0.0f) TskBuf[id].vx -= 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vx -= 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vx < -MAX_SPEED) TskBuf[id].vx = -MAX_SPEED;
+- }
+- if(TskBuf[id].py < ship_py){
+- if(TskBuf[id].vy > +0.0f) TskBuf[id].vy += 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vy += 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vy > +MAX_SPEED) TskBuf[id].vy = +MAX_SPEED;
+- }else{
+- if(TskBuf[id].vy < +0.0f) TskBuf[id].vy -= 1.0f / SPEED_RATE * 2.0f;
+- else TskBuf[id].vy -= 1.0f / SPEED_RATE * 1.5f;
+- if(TskBuf[id].vy < -MAX_SPEED) TskBuf[id].vy = -MAX_SPEED;
+- }
+- TskBuf[id].px += TskBuf[id].vx;
+- TskBuf[id].py += TskBuf[id].vy;
+- if(TskBuf[id].px < -ENEMY_AREAMAX){
+- TskBuf[id].px = -ENEMY_AREAMAX;
+- TskBuf[id].vx = -TskBuf[id].vx / 2;
+- }
+- if(TskBuf[id].px > +ENEMY_AREAMAX){
+- TskBuf[id].px = +ENEMY_AREAMAX;
+- TskBuf[id].vx = -TskBuf[id].vx / 2;
+- }
+- if(TskBuf[id].py < -ENEMY_AREAMAX){
+- TskBuf[id].py = -ENEMY_AREAMAX;
+- TskBuf[id].vy = -TskBuf[id].vy / 2;
+- }
+- if(TskBuf[id].py > +ENEMY_AREAMAX){
+- TskBuf[id].py = +ENEMY_AREAMAX;
+- TskBuf[id].vy = -TskBuf[id].vy / 2;
+- }
++ TskBuf[id].vx = TskBuf[id].px;
++ TskBuf[id].vy = TskBuf[id].py;
++ if(!TskBuf[id].cnt){
++ TskBuf[id].tx = cast(float)(rand() % 512) + 256.0f;
++ TskBuf[id].ty = cast(float)(rand() % 512) + 256.0f;
++ if(TskBuf[id].px < ship_px) TskBuf[id].tx = +TskBuf[id].tx;
++ else TskBuf[id].tx = -TskBuf[id].tx;
++ if(TskBuf[id].py < ship_py) TskBuf[id].ty = +TskBuf[id].ty;
++ else TskBuf[id].ty = -TskBuf[id].ty;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].tx = -TskBuf[id].tx;
++ if(cast(float)(rand() % 100) > 97) TskBuf[id].ty = -TskBuf[id].ty;
++ TskBuf[id].tx = TskBuf[id].px + TskBuf[id].tx;
++ TskBuf[id].ty = TskBuf[id].py + TskBuf[id].ty;
++ if(TskBuf[id].tx < -ENEMY_AREAMAX) TskBuf[id].tx = -ENEMY_AREAMAX + 1.0f;
++ if(TskBuf[id].tx > +ENEMY_AREAMAX) TskBuf[id].tx = +ENEMY_AREAMAX - 1.0f;
++ if(TskBuf[id].ty < -ENEMY_AREAMAX) TskBuf[id].ty = -ENEMY_AREAMAX + 1.0f;
++ if(TskBuf[id].ty > +ENEMY_AREAMAX) TskBuf[id].ty = +ENEMY_AREAMAX - 1.0f;
++ TskBuf[id].cnt = 180;
++ }else{
++ TskBuf[id].cnt--;
++ }
++ TskBuf[id].px += (TskBuf[id].tx - TskBuf[id].px) / (180 / 4);
++ TskBuf[id].py += (TskBuf[id].ty - TskBuf[id].py) / (180 / 4);
++ TskBuf[id].vx -= TskBuf[id].px;
++ TskBuf[id].vy -= TskBuf[id].py;
+ TskBuf[id].rot = atan2(-TskBuf[id].vx, -TskBuf[id].vy);
+ break;
+ default:
+diff -Naur a2k-org/a2k_src/src/enemy08.d a2k/a2k_src/src/enemy08.d
+--- a2k-org/a2k_src/src/enemy08.d 2008-02-06 01:36:04.000000000 +0100
++++ a2k/a2k_src/src/enemy08.d 2008-10-07 10:11:52.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/05 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import SDL;
+ private import opengl;
+@@ -65,8 +65,8 @@
+ switch(TskBuf[id].step){
+ case 0:
+ TskBuf[id].tskid |= TSKID_ZAKO;
+- TskBuf[id].px = (rand() % 1536) - 768.0f;
+- TskBuf[id].py = (rand() % 1536) - 768.0f;
++ TskBuf[id].px = (cast(float)(rand() % 1536) - 768.0f);
++ TskBuf[id].py = (cast(float)(rand() % 1536) - 768.0f);
+ TskBuf[id].tid = ship_id;
+ TskBuf[id].fp_int = null;
+ TskBuf[id].fp_draw = &TSKenemy08Draw;
+diff -Naur a2k-org/a2k_src/src/enemy.d a2k/a2k_src/src/enemy.d
+--- a2k-org/a2k_src/src/enemy.d 2008-02-06 01:35:42.000000000 +0100
++++ a2k/a2k_src/src/enemy.d 2008-10-07 10:03:38.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/14 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import SDL;
+ private import opengl;
+ private import util_sdl;
+@@ -158,6 +158,7 @@
+ return;
+ }
+
++
+ void TSKeshotInt(int id)
+ {
+ TskBuf[id].step = -1;
+@@ -165,6 +166,7 @@
+ return;
+ }
+
++
+ void TSKeshotDrawSimple(int id)
+ {
+ float[XYZ] pos;
+@@ -198,6 +200,7 @@
+ glEnd();
+ }
+
++
+ void TSKeshotDrawActive(int id)
+ {
+ float[XYZ] pos;
+@@ -231,6 +234,7 @@
+ glEnd();
+ }
+
++
+ void TSKeshotExit(int id)
+ {
+ BulletCommand cmd = TskBuf[id].bullet_command;
+@@ -243,6 +247,7 @@
+ }
+ }
+
++
+ float getShipDirection(int id)
+ {
+ float px,py;
+@@ -257,3 +262,4 @@
+ return dir;
+ }
+
++
+diff -Naur a2k-org/a2k_src/src/init.d a2k/a2k_src/src/init.d
+--- a2k-org/a2k_src/src/init.d 2005-05-19 22:31:30.000000000 +0200
++++ a2k/a2k_src/src/init.d 2008-10-07 09:53:28.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2003/12/01 jumpei isshiki
+ */
+
+-private import std.stdio;
++private import std.c.stdio;
+ private import std.stream;
+ private import util_sdl;
+ private import util_snd;
+@@ -101,7 +101,7 @@
+ fd.open("score.dat");
+ if(fd.size() != 12){
+ fd.close();
+- writefln("score.dat initialized");
++ printf("score.dat initialized");
+ fd.create("score.dat");
+ fd.write(high_easy);
+ fd.write(high_normal);
+@@ -112,7 +112,7 @@
+ fd.read(high_hard);
+ }
+ } catch (Error e) {
+- writefln("score.dat initialized");
++ printf("score.dat initialized");
+ fd.create("score.dat");
+ fd.write(high_easy);
+ fd.write(high_normal);
+@@ -126,7 +126,7 @@
+ try {
+ if(fd.size() != 12){
+ fd.close();
+- writefln("config.dat initialized");
++ printf("config.dat initialized");
+ fd.create("config.dat");
+ fd.write(pad_type);
+ fd.write(vol_se);
+@@ -139,7 +139,7 @@
+ volumeSNDmusic(vol_music);
+ }
+ } catch (Error e) {
+- writefln("config.dat initialized");
++ printf("config.dat initialized");
+ fd.create("config.dat");
+ fd.write(pad_type);
+ fd.write(vol_se);
+diff -Naur a2k-org/a2k_src/src/luminous.d a2k/a2k_src/src/luminous.d
+--- a2k-org/a2k_src/src/luminous.d 2008-02-06 01:39:52.000000000 +0100
++++ a2k/a2k_src/src/luminous.d 2008-10-07 09:53:29.000000000 +0200
+@@ -7,7 +7,7 @@
+ */
+
+ private import std.math;
+-private import std.string;
++private import std.c.string;
+ private import opengl;
+ private import util_sdl;
+ private import task;
+diff -Naur a2k-org/a2k_src/src/main.d a2k/a2k_src/src/main.d
+--- a2k-org/a2k_src/src/main.d 2008-02-07 00:42:58.000000000 +0100
++++ a2k/a2k_src/src/main.d 2008-10-07 10:18:53.000000000 +0200
+@@ -6,8 +6,9 @@
+ 2003/11/28 jumpei isshiki
+ */
+
+-private import std.c.windows.windows;
+-private import SDL;
++//private import std.c.windows.windows;
++private import SDL;
++private import SDL_Keysym;
+ private import opengl;
+ private import util_sdl;
+ private import util_pad;
+@@ -31,25 +32,29 @@
+ int pause = 0;
+ int pause_flag = 0;
+ int skip = 0;
+-
++/*
+ extern (Windows)
+ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+ {
++*/
++public int main(char[][] args) {
+ int result;
+-
++/*
+ gc_init();
+ _minit();
+
+ try{
+ _moduleCtor();
+- _moduleUnitTests();
++ _moduleUnitTests();
++*/
+ result = boot();
++/*
+ }catch (Object o){
+ MessageBoxA(null, cast(char*)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION);
+ result = 0;
+ }
+ gc_term();
+-
++*/
+ return result;
+ }
+
+diff -Naur a2k-org/a2k_src/src/middle01.d a2k/a2k_src/src/middle01.d
+--- a2k-org/a2k_src/src/middle01.d 2008-02-06 01:36:06.000000000 +0100
++++ a2k/a2k_src/src/middle01.d 2008-10-07 10:19:15.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/05/05 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/middle02.d a2k/a2k_src/src/middle02.d
+--- a2k-org/a2k_src/src/middle02.d 2008-02-06 01:36:08.000000000 +0100
++++ a2k/a2k_src/src/middle02.d 2008-10-07 10:19:24.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/03 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/middle03.d a2k/a2k_src/src/middle03.d
+--- a2k-org/a2k_src/src/middle03.d 2008-02-06 01:36:12.000000000 +0100
++++ a2k/a2k_src/src/middle03.d 2008-10-07 10:19:32.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/06/07 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/middle04.d a2k/a2k_src/src/middle04.d
+--- a2k-org/a2k_src/src/middle04.d 2008-02-06 01:36:14.000000000 +0100
++++ a2k/a2k_src/src/middle04.d 2008-10-07 10:19:40.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/07/05 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/middle05.d a2k/a2k_src/src/middle05.d
+--- a2k-org/a2k_src/src/middle05.d 2008-02-06 01:36:16.000000000 +0100
++++ a2k/a2k_src/src/middle05.d 2008-10-07 10:19:47.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/07/06 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.random;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/ship.d a2k/a2k_src/src/ship.d
+--- a2k-org/a2k_src/src/ship.d 2008-02-12 23:41:50.000000000 +0100
++++ a2k/a2k_src/src/ship.d 2008-10-07 10:41:21.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2003/12/01 jumpei isshiki
+ */
+
+-private import std.math;
++private import std.c.math;
+ private import std.intrinsic;
+ private import std.random;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/stg.d a2k/a2k_src/src/stg.d
+--- a2k-org/a2k_src/src/stg.d 2005-05-19 22:52:14.000000000 +0200
++++ a2k/a2k_src/src/stg.d 2008-10-07 09:53:29.000000000 +0200
+@@ -91,25 +91,36 @@
+ void TSKstgCtrl(int id)
+ {
+ switch(TskBuf[id].step){
+- case 0:
++ case 0:
+ area_num = AREA_01;
+- scene_num = SCENE_01;
+- debug{
+- //area_num = AREA_02;
+- //area_num = AREA_03;
+- //area_num = AREA_04;
+- //area_num = AREA_05;
+- //scene_num = SCENE_02;
+- //scene_num = SCENE_03;
+- //scene_num = SCENE_04;
+- //scene_num = SCENE_05;
+- //scene_num = SCENE_06;
+- //scene_num = SCENE_07;
+- //scene_num = SCENE_08;
+- //scene_num = SCENE_09;
+- //scene_num = SCENE_10;
+- }
+- stg_bgm = -1;
++ scene_num = SCENE_01;
++
++ switch(area_num){
++ case AREA_01:
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg01);
++ break;
++ case AREA_02:
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg02);
++ break;
++ case AREA_03:
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg03);
++ break;
++ case AREA_04:
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg04);
++ break;
++ case AREA_05:
++ stg_ctrl = STG_MAIN;
++ setTSK(GROUP_01,&TSKstg05);
++ break;
++ default:
++ g_step = GSTEP_CLEAR;
++ break;
++ }
++ stg_bgm = -1;
+ stg_ctrl = STG_INIT;
+ TskBuf[id].step++;
+ break;
+@@ -177,7 +188,7 @@
+ {
+ switch(TskBuf[id].step){
+ case 0:
+- stg_ctrl = STG_INIT;
++// stg_ctrl = ;
+ TskBuf[id].step++;
+ break;
+ case 1:
+diff -Naur a2k-org/a2k_src/src/system.d a2k/a2k_src/src/system.d
+--- a2k-org/a2k_src/src/system.d 2005-05-19 22:31:20.000000000 +0200
++++ a2k/a2k_src/src/system.d 2008-10-07 09:53:29.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/03/24 jumpei isshiki
+ */
+
+-private import std.stdio;
++private import std.c.stdio;
+ private import std.math;
+ private import std.random;
+ private import std.string;
+@@ -22,6 +22,11 @@
+ private import stg;
+ private import bg;
+ private import ship;
++
++const real PI = 0x1.921fb54442d1846ap+1;
++const real PI_2 = 1.57079632679489661923;
++const real PI_4 = 0.78539816339744830962;
++const real SQRT2 = 1.41421356237309504880;
+
+ private char[] str_buf;
+ private int wrk1_time;
+diff -Naur a2k-org/a2k_src/src/task.d a2k/a2k_src/src/task.d
+--- a2k-org/a2k_src/src/task.d 2008-02-07 00:38:58.000000000 +0100
++++ a2k/a2k_src/src/task.d 2008-10-07 09:53:29.000000000 +0200
+@@ -153,7 +153,9 @@
+ TskBuf[i].fp_exit = null;
+ TskBuf[i].image = null;
+ TskBuf[i].bullet_command = null;
+- TskBuf[i].bullet_state = null;
++ TskBuf[i].bullet_state = null;
++ TskBuf[i].bullet_accx = 0;
++ TskBuf[i].bullet_accy = 0;
+ }
+ TskBuf[i].tskid = TSKID_NONE;
+ TskBuf[i].entry = -1;
+diff -Naur a2k-org/a2k_src/src/title.d a2k/a2k_src/src/title.d
+--- a2k-org/a2k_src/src/title.d 2008-02-12 23:50:14.000000000 +0100
++++ a2k/a2k_src/src/title.d 2008-10-07 09:53:29.000000000 +0200
+@@ -6,7 +6,7 @@
+ 2004/04/08 jumpei isshiki
+ */
+
+-private import std.stdio;
++private import std.c.stdio;
+ private import std.math;
+ private import std.string;
+ private import SDL;
+diff -Naur a2k-org/a2k_src/src/util_ascii.d a2k/a2k_src/src/util_ascii.d
+--- a2k-org/a2k_src/src/util_ascii.d 2005-05-19 22:30:50.000000000 +0200
++++ a2k/a2k_src/src/util_ascii.d 2008-10-07 09:53:29.000000000 +0200
+@@ -13,7 +13,15 @@
+
+ const float ASC_SIZE = (16.0f + 2.0f);
+
+-private float[][] ascii_font = [
++float[][] ascii_font;
++
++
++
++private char[] ascii_dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.:!?\"'-=+ 0123456789";
++
++void initASCII()
++{
++static float[][] af = [
+ /* 'A' */
+ [
+ 3, 0, 11, 2,
+@@ -328,10 +336,14 @@
+ ],
+ ];
+
+-private char[] ascii_dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.:!?\"'-=+ 0123456789";
++ ascii_font.length = af.length;
++ for (int i = 0; i < ascii_font.length; i++) {
++ ascii_font[i].length = af[i].length;
++ for (int j = 0; j < ascii_font[i].length; j++) {
++ ascii_font[i][j] = af[i][j];
++ }
++ }
+
+-void initASCII()
+-{
+ for(int i = 0; i < ascii_font.length; i++){
+ for(int j = 0; j < ascii_font[i].length; j += 4){
+ ascii_font[i][j+2] += 1.0f;
+diff -Naur a2k-org/a2k_src/src/util_pad.d a2k/a2k_src/src/util_pad.d
+--- a2k-org/a2k_src/src/util_pad.d 2008-02-12 23:46:38.000000000 +0100
++++ a2k/a2k_src/src/util_pad.d 2008-10-07 09:53:29.000000000 +0200
+@@ -7,7 +7,8 @@
+ */
+
+ private import SDL;
+-
++private import SDL_Keysym;
++private import SDL_keyboard;
+ enum{
+ PAD_UP = 0x01,
+ PAD_DOWN = 0x02,
+diff -Naur a2k-org/a2k_src/src/util_sdl.d a2k/a2k_src/src/util_sdl.d
+--- a2k-org/a2k_src/src/util_sdl.d 2008-02-06 01:41:02.000000000 +0100
++++ a2k/a2k_src/src/util_sdl.d 2008-10-07 10:30:33.000000000 +0200
+@@ -6,9 +6,12 @@
+ 2003/11/28 jumpei isshiki
+ */
+
++private import std.stdio;
+ private import std.string;
+-private import SDL;
++private import SDL;
++private import SDL_mouse;
+ private import opengl;
++private import util_pad;
+ private import define;
+
+ enum{
+@@ -30,11 +33,18 @@
+ EX,
+ EY,
+ }
+-
++
++struct VEC_POS {
++ float px;
++ float py;
++ float pz;
++}
+
+ SDL_Surface* primary;
+ SDL_Surface*[] offscreen;
+-
++
++const float SCREEN_RATIOX = cast(float)(SCREEN_X / 2.0f);
++const float SCREEN_RATIOY = cast(float)(SCREEN_Y / 2.0f);
+ const float BASE_Z = 2.0f;
+ float cam_scr = -0.75f;
+ float cam_pos;
+@@ -43,20 +53,27 @@
+ private int height = SCREEN_Y;
+ private float nearPlane = 0.0f;
+ private float farPlane = 1000.0f;
+-
++private GLuint TEXTURE_NONE = 0xffffffff;
+ private GLuint[] tex_bank;
+
+-int initSDL()
++int initSDL()
++
+ {
+ if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0){
+ return 0;
+ }
+
+ Uint32 videoFlags;
+- videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
++// videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
+ //videoFlags = SDL_OPENGL | SDL_RESIZABLE;
+ debug{
+- videoFlags = SDL_OPENGL | SDL_RESIZABLE;
++ if((pads & PAD_BUTTON1)){
++ videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
++ }else{
++ videoFlags = SDL_OPENGL | SDL_RESIZABLE;
++ }
++ }else{
++ videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
+ }
+ primary = SDL_SetVideoMode(width, height, 0, videoFlags);
+ if(primary == null){
+@@ -67,14 +84,15 @@
+ tex_bank.length = SURFACE_MAX;
+ for(int i = 0; i < SURFACE_MAX; i++){
+ offscreen[i] = null;
+- tex_bank[i] = cast(GLuint)-1;
++ tex_bank[i] = TEXTURE_NONE;
+ }
+
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ resizedSDL(width, height);
+ SDL_ShowCursor(SDL_DISABLE);
+
+- SDL_WM_SetCaption(cast(char*)PROJECT_NAME, null);
++ SDL_WM_SetCaption(cast(char*)PROJECT_NAME, null);
++ SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), null);
+
+ return 1;
+ }
+@@ -96,9 +114,9 @@
+ SDL_ShowCursor(SDL_ENABLE);
+ SDL_Quit();
+ }
++
+
+-
+-void readSDLtexture(char[] fname, int bank)
++void readSDLtexture(char[] fname, int bank)
+ {
+ offscreen[bank] = SDL_LoadBMP(toStringz(fname));
+ if(offscreen[bank]){
+@@ -110,31 +128,28 @@
+ }
+ }
+
+-
+-void bindSDLtexture(int bank)
++void bindSDLtexture(int bank)
+ {
+- if(tex_bank[bank] != -1) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
++ if(tex_bank[bank] != TEXTURE_NONE) glBindTexture(GL_TEXTURE_2D, tex_bank[bank]);
+ }
+
+-
+-void clearSDL()
++void clearSDL()
+ {
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+
+-
+-void flipSDL()
++void flipSDL()
+ {
+ glFlush();
+ SDL_GL_SwapBuffers();
+ }
+
+-
+-void resizedSDL(int w, int h)
++void resizedSDL(int w, int h)
+ {
+ glViewport(0, 0, w, h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
++ w = (w ? w : 1);
+ glFrustum(-nearPlane,nearPlane,
+ -nearPlane * h / w,
+ nearPlane * h / w,
+diff -Naur a2k-org/makefile a2k/makefile
+--- a2k-org/makefile 1970-01-01 01:00:00.000000000 +0100
++++ a2k/makefile 2008-10-07 09:53:29.000000000 +0200
+@@ -0,0 +1,18 @@
++DSRC=$(shell find a2k_src/src -name "*.d")
++SOURCES=$(DSRC) a2k_src/import/SDL_video.d a2k_src/import/SDL_mixer.d
++OBJS=$(SOURCES:.d=.o)
++CFLAGS=
++DFLAGS=-O -Ia2k_src/import -Ia2k_src/src -I/usr/X11R6/include/
++EXE=area2048
++
++all: $(EXE)
++
++$(EXE): $(OBJS)
++ gcc $(CFLAGS) -o $@ $(OBJS) $(COBJS) -lbulletml_d -L/usr/local/lib -L/usr/lib -lgphobos -lpthread -lGLU -lGL -lglut -lm -lstdc++ -lSDL -lSDL_mixer
++
++$(OBJS): %.o: %.d
++ gdmd -d -c -of$@ $(DFLAGS) $<
++
++clean:
++ rm a2k_src/src/*.o
++