diff -Naur a2k/a2k_src/import/opengl.d a2k-gentoo/a2k_src/import/opengl.d --- a2k/a2k_src/import/opengl.d 2004-01-09 10:52:04.000000000 +0100 +++ a2k-gentoo/a2k_src/import/opengl.d 2007-09-19 22:23:59.000000000 +0200 @@ -1,10 +1,6 @@ -version (Win32) { - private import std.c.windows.windows; - extern(Windows): -} -version (linux) { + extern(C): -} + alias uint GLenum; alias ubyte GLboolean; @@ -1116,7 +1112,7 @@ /*************************************************************/ void /*APIENTRY*/glAccum (GLenum op, GLfloat value); -void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref); +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); @@ -1369,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 ref, 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/a2k_src/import/openglu.d a2k-gentoo/a2k_src/import/openglu.d --- a2k/a2k_src/import/openglu.d 2003-12-04 04:15:26.000000000 +0100 +++ a2k-gentoo/a2k_src/import/openglu.d 2007-09-19 22:24:06.000000000 +0200 @@ -1,11 +1,6 @@ -import opengl; -version (Win32) { - extern(Windows): -} -version (linux) { extern(C): -} + GLubyte* gluErrorString ( GLenum errCode); diff -Naur a2k/a2k_src/import/SDL.d a2k-gentoo/a2k_src/import/SDL.d --- a2k/a2k_src/import/SDL.d 2004-05-08 14:14:14.000000000 +0200 +++ a2k-gentoo/a2k_src/import/SDL.d 2007-09-19 22:23:25.000000000 +0200 @@ -20,73 +20,73 @@ slouken@devolution.com */ -import SDL_types; -import SDL_getenv; -import SDL_error; -import SDL_rwops; -import SDL_timer; -import SDL_audio; -import SDL_cdrom; -import SDL_joystick; -import SDL_events; -import SDL_video; -import SDL_byteorder; -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(); -} +public import SDL_types; +public import SDL_getenv; +public import SDL_error; +public import SDL_rwops; +public import SDL_timer; +public import SDL_audio; +public import SDL_cdrom; +public import SDL_joystick; +public import SDL_events; +public import SDL_video; +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*); + +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/a2k_src/import/SDL_events.d a2k-gentoo/a2k_src/import/SDL_events.d --- a2k/a2k_src/import/SDL_events.d 2004-12-02 15:48:16.000000000 +0100 +++ a2k-gentoo/a2k_src/import/SDL_events.d 2007-09-19 22:23:25.000000000 +0200 @@ -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/a2k_src/import/SDL_keysym.d a2k-gentoo/a2k_src/import/SDL_keysym.d --- a2k/a2k_src/import/SDL_keysym.d 2002-01-04 15:31:22.000000000 +0100 +++ a2k-gentoo/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/a2k_src/import/SDL_Keysym.d a2k-gentoo/a2k_src/import/SDL_Keysym.d --- a2k/a2k_src/import/SDL_Keysym.d 1970-01-01 01:00:00.000000000 +0100 +++ a2k-gentoo/a2k_src/import/SDL_Keysym.d 2007-09-19 22:23:25.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/a2k_src/import/SDL_version.d a2k-gentoo/a2k_src/import/SDL_version.d --- a2k/a2k_src/import/SDL_version.d 2003-12-06 12:47:54.000000000 +0100 +++ a2k-gentoo/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 */ - -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/a2k_src/import/SDL_Version.d a2k-gentoo/a2k_src/import/SDL_Version.d --- a2k/a2k_src/import/SDL_Version.d 1970-01-01 01:00:00.000000000 +0100 +++ a2k-gentoo/a2k_src/import/SDL_Version.d 2007-09-19 22:23:25.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/a2k_src/src/bg.d a2k-gentoo/a2k_src/src/bg.d --- a2k/a2k_src/src/bg.d 2005-01-17 16:34:48.000000000 +0100 +++ a2k-gentoo/a2k_src/src/bg.d 2007-09-19 22:23:25.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/a2k_src/src/boss01.d a2k-gentoo/a2k_src/src/boss01.d --- a2k/a2k_src/src/boss01.d 2004-09-13 17:57:16.000000000 +0200 +++ a2k-gentoo/a2k_src/src/boss01.d 2007-09-19 22:23:25.000000000 +0200 @@ -7,7 +7,7 @@ */ private import std.stdio; -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/boss02.d a2k-gentoo/a2k_src/src/boss02.d --- a2k/a2k_src/src/boss02.d 2004-09-13 18:11:00.000000000 +0200 +++ a2k-gentoo/a2k_src/src/boss02.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/04/16 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/boss03.d a2k-gentoo/a2k_src/src/boss03.d --- a2k/a2k_src/src/boss03.d 2004-09-14 16:45:24.000000000 +0200 +++ a2k-gentoo/a2k_src/src/boss03.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/08 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; @@ -359,7 +359,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/a2k_src/src/boss04.d a2k-gentoo/a2k_src/src/boss04.d --- a2k/a2k_src/src/boss04.d 2004-09-15 16:23:28.000000000 +0200 +++ a2k-gentoo/a2k_src/src/boss04.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/06 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/boss05.d a2k-gentoo/a2k_src/src/boss05.d --- a2k/a2k_src/src/boss05.d 2004-09-15 16:23:46.000000000 +0200 +++ a2k-gentoo/a2k_src/src/boss05.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/09 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/bulletcommand.d a2k-gentoo/a2k_src/src/bulletcommand.d --- a2k/a2k_src/src/bulletcommand.d 2004-09-05 17:55:02.000000000 +0200 +++ a2k-gentoo/a2k_src/src/bulletcommand.d 2007-09-19 22:23:25.000000000 +0200 @@ -36,7 +36,7 @@ buf.length = 256; buf = fname ~ "\0"; - parser[bank] = BulletMLParserTinyXML_new(buf); + parser[bank] = BulletMLParserTinyXML_new(buf.ptr); if(parser[bank]) BulletMLParserTinyXML_parse(parser[bank]); buf.length = 0; } @@ -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/a2k_src/src/define.d a2k-gentoo/a2k_src/src/define.d --- a2k/a2k_src/src/define.d 2004-09-15 16:25:04.000000000 +0200 +++ a2k-gentoo/a2k_src/src/define.d 2007-09-19 22:23:25.000000000 +0200 @@ -9,10 +9,10 @@ const char[] PROJECT_NAME = "AREA2048"; enum{ - /* グラフィック関係 */ + /**/ GRP_TITLE = 0, - /* BGM関係 */ + /* */ SND_BGM01 = 0, SND_BGM02, SND_BGM03, @@ -21,7 +21,7 @@ SND_BOSS01, SND_BOSS02, - /* SE関係 */ + /* */ SND_SE_SDEST = 0, SND_SE_EDMG, SND_SE_EDEST, @@ -33,7 +33,7 @@ SND_SE_LOCK_ON, SND_SE_LOCK_OFF, - /* VOICE関係 */ + /* */ SND_VOICE_GETREADY = 16, SND_VOICE_EXTEND, SND_VOICE_CHARGE, @@ -42,7 +42,7 @@ SND_VOICE_EMERGENCY, SND_VOICE_AREA, - /* 弾関係 */ + /* */ BULLET_SHIP01 = 0, BULLET_SHIP02, @@ -82,7 +82,7 @@ BULLET_BOSS0505, BULLET_BOSS0506, - /* エリア/シーン関係 */ + /* */ AREA_01 = 0, AREA_02, AREA_03, @@ -101,13 +101,13 @@ SCENE_10, SCENE_11, - /* ステージコントロール */ + /* */ STG_INIT = 0, STG_MAIN, STG_CLEAR, STG_GAMEOVER, - /* 敵関係 */ + /**/ ENMEY_01 = 0, ENMEY_02, ENMEY_03, @@ -127,7 +127,7 @@ BOSS_04, BOSS_05, - /* シーケンスコントロール */ + /* */ SEQ_WAIT = 0, SEQ_SETENEMY, SEQ_SETENEMYID, @@ -166,7 +166,7 @@ SEQ_FADE, SEQ_END, - /* その他 */ + /**/ ONE_SEC = 60, ONE_MIN = ONE_SEC * 60, } diff -Naur a2k/a2k_src/src/effect.d a2k-gentoo/a2k_src/src/effect.d --- a2k/a2k_src/src/effect.d 2005-01-17 16:22:44.000000000 +0100 +++ a2k-gentoo/a2k_src/src/effect.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/03/31 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; @@ -14,7 +14,8 @@ 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; @@ -54,16 +55,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; @@ -75,8 +76,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; @@ -166,16 +167,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; @@ -187,8 +188,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; @@ -280,13 +281,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); @@ -411,13 +412,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); @@ -507,7 +508,7 @@ z = BASE_Z - cam_pos; - /* フェード表示 */ + glBegin(GL_QUADS); glColor4f(fade_r,fade_g,fade_b,fade_a); glVertex3f(getPointX(TskBuf[id].px-(SCREEN_Y / 2), z), @@ -566,7 +567,7 @@ z = BASE_Z - cam_pos; - /* フェード表示 */ + glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); glBegin(GL_QUADS); glColor4f(fade_r,fade_g,fade_b,fade_a); diff -Naur a2k/a2k_src/src/enemy01.d a2k-gentoo/a2k_src/src/enemy01.d --- a2k/a2k_src/src/enemy01.d 2004-09-09 17:57:54.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy01.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/03/27 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -64,8 +64,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; @@ -102,7 +102,7 @@ TskBuf[id].step++; } case 2: - /* 座標更新 */ + /* */ 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; diff -Naur a2k/a2k_src/src/enemy02.d a2k-gentoo/a2k_src/src/enemy02.d --- a2k/a2k_src/src/enemy02.d 2004-09-09 17:58:10.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy02.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/04/11 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -64,8 +64,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; @@ -103,14 +103,14 @@ TskBuf[id].step++; } case 2: - /* 移動モード更新 */ + /* */ if(!TskBuf[id].mov_cnt){ TskBuf[id].mov_mode = (rand() % 100) & 0x01; TskBuf[id].mov_cnt = (rand() % 60) + 60; }else{ TskBuf[id].mov_cnt--; } - /* 座標更新 */ + /* */ switch(TskBuf[id].mov_mode){ case 0: if(TskBuf[id].px < ship_px){ diff -Naur a2k/a2k_src/src/enemy03.d a2k-gentoo/a2k_src/src/enemy03.d --- a2k/a2k_src/src/enemy03.d 2004-09-09 17:58:08.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy03.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/04/11 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -64,8 +64,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; @@ -109,7 +109,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -138,7 +138,7 @@ } } } - /* 座標更新 */ + /* */ if(TskBuf[id].px < ship_px){ if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 1.5f; else TskBuf[id].vx += 1.0f / SPEED_RATE * 2.0f; diff -Naur a2k/a2k_src/src/enemy04.d a2k-gentoo/a2k_src/src/enemy04.d --- a2k/a2k_src/src/enemy04.d 2004-09-09 17:58:02.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy04.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/04/11 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -54,8 +54,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; @@ -100,7 +100,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -129,18 +129,18 @@ } } } - /* 座標更新 */ + /**/ 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/a2k_src/src/enemy05.d a2k-gentoo/a2k_src/src/enemy05.d --- a2k/a2k_src/src/enemy05.d 2004-09-09 17:57:58.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy05.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/05/30 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -54,8 +54,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; @@ -98,7 +98,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -127,43 +127,32 @@ } } } - /* 座標更新 */ - 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; +/**/ + 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{ - 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].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/a2k_src/src/enemy06.d a2k-gentoo/a2k_src/src/enemy06.d --- a2k/a2k_src/src/enemy06.d 2004-09-09 17:58:04.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy06.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/04 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -66,8 +66,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; @@ -113,7 +113,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -142,18 +142,18 @@ } } } - /* 座標更新 */ + /* */ 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/a2k_src/src/enemy07.d a2k-gentoo/a2k_src/src/enemy07.d --- a2k/a2k_src/src/enemy07.d 2004-09-09 17:57:50.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy07.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/05 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -64,8 +64,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; @@ -108,7 +108,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -137,43 +137,32 @@ } } } - /* 座標更新 */ - 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; +/**/ + 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{ - 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].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/a2k_src/src/enemy08.d a2k-gentoo/a2k_src/src/enemy08.d --- a2k/a2k_src/src/enemy08.d 2004-09-09 17:57:46.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy08.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/05 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import SDL; @@ -66,8 +66,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; @@ -113,7 +113,7 @@ TskBuf[id].step++; } case 2: - /* 弾撃ち */ + /* */ if(cmd){ if(TskBuf[id].bullet_wait){ if(cmd.isEnd()) TskBuf[id].bullet_wait--; @@ -142,7 +142,7 @@ } } } - /* 座標更新 */ + /* */ if(TskBuf[id].px < ship_px){ if(TskBuf[id].vx > +0.0f) TskBuf[id].vx += 1.0f / SPEED_RATE * 3.0f; else TskBuf[id].vx += 1.0f / SPEED_RATE * 1.0f; diff -Naur a2k/a2k_src/src/enemy.d a2k-gentoo/a2k_src/src/enemy.d --- a2k/a2k_src/src/enemy.d 2004-09-23 15:17:42.000000000 +0200 +++ a2k-gentoo/a2k_src/src/enemy.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/04/14 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import SDL; private import opengl; @@ -159,6 +159,7 @@ return; } + void TSKeshotInt(int id) { TskBuf[id].step = -1; @@ -166,6 +167,7 @@ return; } + void TSKeshotDrawSimple(int id) { float[XYZ] pos; @@ -199,6 +201,7 @@ glEnd(); } + void TSKeshotDrawActive(int id) { float[XYZ] pos; @@ -232,6 +235,7 @@ glEnd(); } + void TSKeshotExit(int id) { BulletCommand cmd = TskBuf[id].bullet_command; @@ -244,6 +248,7 @@ } } + float getShipDirection(int id) { float px,py; @@ -258,3 +263,4 @@ return dir; } + diff -Naur a2k/a2k_src/src/init.d a2k-gentoo/a2k_src/src/init.d --- a2k/a2k_src/src/init.d 2004-09-15 16:24:58.000000000 +0200 +++ a2k-gentoo/a2k_src/src/init.d 2007-09-19 22:23:25.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; @@ -22,7 +22,7 @@ void sndINIT() { - /* 曲 */ + /**/ loadSNDmusic("stg01.ogg",SND_BGM01); loadSNDmusic("stg02.ogg",SND_BGM02); loadSNDmusic("stg03.ogg",SND_BGM03); @@ -100,7 +100,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); @@ -111,7 +111,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); @@ -125,7 +125,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); @@ -138,7 +138,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/a2k_src/src/init.d.orig a2k-gentoo/a2k_src/src/init.d.orig --- a2k/a2k_src/src/init.d.orig 1970-01-01 01:00:00.000000000 +0100 +++ a2k-gentoo/a2k_src/src/init.d.orig 2004-09-15 16:24:58.000000000 +0200 @@ -0,0 +1,166 @@ +/* + D-System 'INITIALIZE' + + 'init.d' + + 2003/12/01 jumpei isshiki +*/ + +private import std.stdio; +private import std.stream; +private import util_sdl; +private import util_snd; +private import util_pad; +private import bulletcommand; +private import define; +private import gctrl; + +void grpINIT() +{ + readSDLtexture("title.bmp", GRP_TITLE); +} + +void sndINIT() +{ + /* 曲 */ + loadSNDmusic("stg01.ogg",SND_BGM01); + loadSNDmusic("stg02.ogg",SND_BGM02); + loadSNDmusic("stg03.ogg",SND_BGM03); + loadSNDmusic("stg04.ogg",SND_BGM04); + loadSNDmusic("stg05.ogg",SND_BGM05); + loadSNDmusic("boss01.ogg",SND_BOSS01); + loadSNDmusic("boss02.ogg",SND_BOSS02); + /* SE */ + loadSNDse("se_sdest.wav",SND_SE_SDEST,1); + loadSNDse("se_dmg01.wav",SND_SE_EDMG,2); + loadSNDse("se_explode01.wav",SND_SE_EDEST,3); + loadSNDse("se_explode02.wav",SND_SE_EEXP01,3); + loadSNDse("se_explode03.wav",SND_SE_EEXP02,3); + loadSNDse("se_cursole.wav",SND_SE_CURSOLE,1); + loadSNDse("se_correct.wav",SND_SE_CORRECT,1); + loadSNDse("se_cancel.wav",SND_SE_CANCEL,1); + loadSNDse("se_lock_on.wav",SND_SE_LOCK_ON,1); + loadSNDse("se_lock_off.wav",SND_SE_LOCK_OFF,1); + /* VOICE */ + loadSNDse("voice04.wav",SND_VOICE_GETREADY,7); + loadSNDse("voice06.wav",SND_VOICE_EXTEND,6); + loadSNDse("voice07.wav",SND_VOICE_CHARGE,5); + loadSNDse("voice08.wav",SND_VOICE_SCENE,7); + loadSNDse("voice09.wav",SND_VOICE_COMPLETE,7); + loadSNDse("voice10.wav",SND_VOICE_EMERGENCY,7); + loadSNDse("voice11.wav",SND_VOICE_AREA,7); + + volumeSNDse(vol_se); + volumeSNDmusic(vol_music); +} + +void bulletINIT() +{ + /* BULLET */ + initBulletcommandParser(256); + readBulletcommandParser( BULLET_SHIP01, "bullet01.xml"); + readBulletcommandParser( BULLET_SHIP02, "bullet02.xml"); + readBulletcommandParser( BULLET_ZAKO03, "bulletzako03.xml"); + readBulletcommandParser( BULLET_ZAKO04, "bulletzako04.xml"); + readBulletcommandParser( BULLET_ZAKO05, "bulletzako05.xml"); + readBulletcommandParser( BULLET_ZAKO06, "bulletzako06.xml"); + readBulletcommandParser( BULLET_ZAKO07, "bulletzako07.xml"); + readBulletcommandParser( BULLET_ZAKO08, "bulletzako08.xml"); + readBulletcommandParser( BULLET_MIDDLE01, "bulletmid01.xml"); + readBulletcommandParser( BULLET_MIDDLE02, "bulletmid02.xml"); + readBulletcommandParser( BULLET_MIDDLE03, "bulletmid03.xml"); + readBulletcommandParser( BULLET_MIDDLE04, "bulletmid04.xml"); + readBulletcommandParser( BULLET_MIDDLE05, "bulletmid05.xml"); + readBulletcommandParser( BULLET_BOSS0101, "bulletboss0101.xml"); + readBulletcommandParser( BULLET_BOSS0102, "bulletboss0102.xml"); + readBulletcommandParser( BULLET_BOSS0201, "bulletboss0201.xml"); + readBulletcommandParser( BULLET_BOSS0202, "bulletboss0202.xml"); + readBulletcommandParser( BULLET_BOSS0301, "bulletboss0301.xml"); + readBulletcommandParser( BULLET_BOSS0302, "bulletboss0302.xml"); + readBulletcommandParser( BULLET_BOSS0401, "bulletboss0401.xml"); + readBulletcommandParser( BULLET_BOSS0402, "bulletboss0402.xml"); + readBulletcommandParser( BULLET_BOSS0403, "bulletboss0403.xml"); + readBulletcommandParser( BULLET_BOSS0404, "bulletboss0404.xml"); + readBulletcommandParser( BULLET_BOSS0501, "bulletboss0501.xml"); + readBulletcommandParser( BULLET_BOSS0502, "bulletboss0502.xml"); + readBulletcommandParser( BULLET_BOSS0503, "bulletboss0503.xml"); + readBulletcommandParser( BULLET_BOSS0504, "bulletboss0504.xml"); + readBulletcommandParser( BULLET_BOSS0505, "bulletboss0505.xml"); + readBulletcommandParser( BULLET_BOSS0506, "bulletboss0506.xml"); +} + +void configINIT() +{ + high_easy = 0; + high_normal = 0; + high_hard = 0; + + auto File fd = new File; + try { + fd.open("score.dat"); + if(fd.size() != 12){ + fd.close(); + writefln("score.dat initialized"); + fd.create("score.dat"); + fd.write(high_easy); + fd.write(high_normal); + fd.write(high_hard); + }else{ + fd.read(high_easy); + fd.read(high_normal); + fd.read(high_hard); + } + } catch (Error e) { + writefln("score.dat initialized"); + fd.create("score.dat"); + fd.write(high_easy); + fd.write(high_normal); + fd.write(high_hard); + fd.close(); + } finally { + fd.close(); + } + + fd.open("config.dat"); + try { + if(fd.size() != 12){ + fd.close(); + writefln("config.dat initialized"); + fd.create("config.dat"); + fd.write(pad_type); + fd.write(vol_se); + fd.write(vol_music); + }else{ + fd.read(pad_type); + fd.read(vol_se); + fd.read(vol_music); + volumeSNDse(vol_se); + volumeSNDmusic(vol_music); + } + } catch (Error e) { + writefln("config.dat initialized"); + fd.create("config.dat"); + fd.write(pad_type); + fd.write(vol_se); + fd.write(vol_music); + fd.close(); + } finally { + fd.close(); + } +} + +void configSAVE() +{ + auto File fd = new File; + fd.create("score.dat"); + fd.write(high_easy); + fd.write(high_normal); + fd.write(high_hard); + fd.close(); + + fd.create("config.dat"); + fd.write(pad_type); + fd.write(vol_se); + fd.write(vol_music); + fd.close(); +} diff -Naur a2k/a2k_src/src/luminous.d a2k-gentoo/a2k_src/src/luminous.d --- a2k/a2k_src/src/luminous.d 2004-07-11 16:01:58.000000000 +0200 +++ a2k-gentoo/a2k_src/src/luminous.d 2007-09-19 22:23:25.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; @@ -69,7 +69,7 @@ static void makeLuminousTexture() { - uint *data = td; + uint *data = td.ptr; int i; memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof); diff -Naur a2k/a2k_src/src/main.d a2k-gentoo/a2k_src/src/main.d --- a2k/a2k_src/src/main.d 2004-09-15 16:54:42.000000000 +0200 +++ a2k-gentoo/a2k_src/src/main.d 2007-09-19 22:23:25.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; @@ -32,23 +33,24 @@ int pause_flag = 0; int skip = 0; -extern (Windows) -int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) -{ +//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(); + +// gc_init(); +// _minit(); + +// try{ +// _moduleCtor(); +// _moduleUnitTests(); result = boot(); - }catch (Object o){ - MessageBoxA(null, o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION); - result = 0; - } - gc_term(); +// }catch (Object o){ +// MessageBoxA(null, o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION); +// result = 0; +// } +// gc_term(); return result; } @@ -158,7 +160,7 @@ int prev; int group; - /* 自機弾 */ + /* */ group = GROUP_04; for(int i = TskIndex[group]; i != -1; i = prev){ prev = TskBuf[i].prev; @@ -166,7 +168,7 @@ collision_sub1(i, GROUP_02); } } - /* 自機 */ + /**/ if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub2(ship_id, GROUP_02); if(TskBuf[ship_id].tskid != 0 && TskBuf[ship_id].fp_int) collision_sub3(ship_id, GROUP_06); @@ -188,7 +190,7 @@ sex = cast(int)(TskBuf[id].px + TskBuf[id].cx); sey = cast(int)(TskBuf[id].py + TskBuf[id].cy); - /* 敵 */ + /* */ for(int i = TskIndex[group]; i != -1; i = prev){ prev = TskBuf[i].prev; if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){ @@ -227,7 +229,7 @@ sex = cast(int)(TskBuf[id].px + TskBuf[id].cx); sey = cast(int)(TskBuf[id].py + TskBuf[id].cy); - /* 敵 */ + /* */ for(int i = TskIndex[group]; i != -1; i = prev){ prev = TskBuf[i].prev; if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){ @@ -264,7 +266,7 @@ sex = cast(int)(TskBuf[id].px + TskBuf[id].cx); sey = cast(int)(TskBuf[id].py + TskBuf[id].cy); - /* 敵弾 */ + /* */ for(int i = TskIndex[group]; i != -1; i = prev){ prev = TskBuf[i].prev; if(TskBuf[i].tskid != 0 && TskBuf[i].fp_int){ diff -Naur a2k/a2k_src/src/middle01.d a2k-gentoo/a2k_src/src/middle01.d --- a2k/a2k_src/src/middle01.d 2004-09-13 18:19:36.000000000 +0200 +++ a2k-gentoo/a2k_src/src/middle01.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/05/05 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/middle02.d a2k-gentoo/a2k_src/src/middle02.d --- a2k/a2k_src/src/middle02.d 2004-09-14 15:49:54.000000000 +0200 +++ a2k-gentoo/a2k_src/src/middle02.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/03 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/middle03.d a2k-gentoo/a2k_src/src/middle03.d --- a2k/a2k_src/src/middle03.d 2004-09-14 15:55:16.000000000 +0200 +++ a2k-gentoo/a2k_src/src/middle03.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/06/07 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/middle04.d a2k-gentoo/a2k_src/src/middle04.d --- a2k/a2k_src/src/middle04.d 2004-09-14 17:17:00.000000000 +0200 +++ a2k-gentoo/a2k_src/src/middle04.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/07/05 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/middle05.d a2k-gentoo/a2k_src/src/middle05.d --- a2k/a2k_src/src/middle05.d 2004-09-14 17:42:18.000000000 +0200 +++ a2k-gentoo/a2k_src/src/middle05.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2004/07/06 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.c.math; private import std.random; private import std.string; diff -Naur a2k/a2k_src/src/ship.d a2k-gentoo/a2k_src/src/ship.d --- a2k/a2k_src/src/ship.d 2005-01-17 17:51:18.000000000 +0100 +++ a2k-gentoo/a2k_src/src/ship.d 2007-09-19 22:23:25.000000000 +0200 @@ -6,7 +6,7 @@ 2003/12/01 jumpei isshiki */ -private import std.math; +//private import std.math; private import std.intrinsic; private import std.random; private import std.c.math; @@ -204,7 +204,7 @@ old_dat = pad_dat; pad_dat = getAttractPadData(id); trg_dat = getAttractTrgData(id,pad_dat,old_dat); - /* ロック処理 */ + ship_trg = getNearEnemy(id,512.0f); if((trg_dat & PAD_SHOT) && ship_trg != -1){ ship_lock = 1; @@ -213,7 +213,7 @@ ship_lock = 0; TskBuf[id].trg_id = -1; } - /* 方向取得(敏感に反応しないための処理) */ + int trg = trg_dat & PAD_DIR; int pad = pad_dat & PAD_DIR; if(trg){ @@ -229,7 +229,7 @@ ship_pbk = 0; ship_cnt = 0; } - /* 速度&方向設定 */ + if(ship_lock == 0){ if(ship_pad) TskBuf[id].rot = ship_move[ship_pad][0]; }else{ @@ -243,7 +243,7 @@ TskBuf[id].ax *= 1.5f; TskBuf[id].ay *= 1.5f; } - /* 加減速 */ + acc = ACC_RATE; if(TskBuf[id].ax != 0.0f){ if(TskBuf[id].vx < TskBuf[id].ax){ @@ -269,7 +269,7 @@ }else{ TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f); } - /* 座標更新 */ + TskBuf[id].px += TskBuf[id].vx; TskBuf[id].py += TskBuf[id].vy; if(TskBuf[id].px < -SHIP_AREAMAX){ @@ -296,7 +296,7 @@ ship_py = TskBuf[id].py; TskBuf[id].tx = TskBuf[id].px + sin(TskBuf[id].rot) * 1.0f; TskBuf[id].ty = TskBuf[id].py + cos(TskBuf[id].rot) * 1.0f; - /* ボム */ + if(!enemy_stg) BombOFF(); if(TskBuf[id].step == 2){ if(bomb && BombTST() && (trg_dat & PAD_BOMB)){ @@ -304,7 +304,7 @@ BombEXEC(); } } - /* ショット */ + if(BombTSTwait()){ cmd.vanish(); BombSTOP(); @@ -331,13 +331,13 @@ else cmd.set(id, BULLET_SHIP02); } } - /* ボム溜め */ + if(BombTST()){ if((pad_dat & PAD_SHOT)) BmbGaugeAdd(BOMB_ADD_MIN); else BmbGaugeAdd(BOMB_ADD_MAX); BombREMAINscore(); } - /* 時間チェック */ + if(time_flag && !time_left){ playSNDse(SND_SE_SDEST); effSetBrokenLine(id, ship_line, 0, 10, 0.0f, 0.0f); @@ -352,7 +352,7 @@ TskBuf[id].step = 255; break; } - /* クリアチェック */ + if(!enemy_stg){ TskBuf[id].fp_int = null; TskBuf[id].tskid |= TSKID_MUTEKI; @@ -387,7 +387,7 @@ cmd.vanish(); TskBuf[id].step++; case 102: - /* 座標更新 */ + acc = ACC_RATE; TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f); TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f); @@ -423,7 +423,7 @@ acc = ACC_RATE; BombOFF(); TskBuf[id].alpha = 1.00f; - /* 座標更新 */ + TskBuf[id].vx -= TskBuf[id].vx / (acc * 2.0f); TskBuf[id].vy -= TskBuf[id].vy / (acc * 2.0f); TskBuf[id].px += TskBuf[id].vx; @@ -1059,7 +1059,7 @@ int eid = getNearEnemy(id, 4096.0f); int pad = 0; - /* 移動 */ + if(eid != -1){ if(TskBuf[id].px > TskBuf[eid].px){ pad |= PAD_RIGHT; @@ -1085,7 +1085,7 @@ demo_eid = eid; } - /* ショット */ + if(!demo_fire && eid != -1){ demo_fire = rand() % 120 + 120; }else{ diff -Naur a2k/a2k_src/src/stg.d a2k-gentoo/a2k_src/src/stg.d --- a2k/a2k_src/src/stg.d 2005-01-17 17:58:42.000000000 +0100 +++ a2k-gentoo/a2k_src/src/stg.d 2007-09-19 22:23:25.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/a2k_src/src/system.d a2k-gentoo/a2k_src/src/system.d --- a2k/a2k_src/src/system.d 2005-01-17 17:31:52.000000000 +0100 +++ a2k-gentoo/a2k_src/src/system.d 2007-09-19 22:23:25.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; @@ -59,7 +64,7 @@ float[XY] base; float gauge; - /* 文字情報描画 */ + glBegin(GL_QUADS); glColor3f(1.0f,1.0f,1.0f); str_buf = "SCORE "; @@ -101,7 +106,7 @@ drawASCII(str_buf, -(SCREEN_S / 2) + 8 + (getWidthASCII(" ",0.5f)), -(SCREEN_S / 2) + 20, 0.50f); glEnd(); - /* ボムゲージ描画 */ + z = BASE_Z - cam_pos; base[X] = -(SCREEN_S / 2) + 4 + getWidthASCII(" ",0.5f); @@ -195,7 +200,7 @@ z = BASE_Z - cam_pos; - /* レーダーBG表示 */ + glColor4f(0.05f,0.50f,0.05f,0.25f); glBegin(GL_QUADS); glVertex3f(getPointX(TskBuf[id].px-64.0f, z), @@ -228,7 +233,7 @@ glEnd(); glBegin(GL_QUADS); - /* 敵表示 */ + for(int i = TskIndex[GROUP_02]; i != -1; i = prev){ glColor4f(1.0f,0.0f,0.0f,TskBuf[i].alpha); prev = TskBuf[i].prev; @@ -251,7 +256,7 @@ 0.0f); } } - /* 自機表示 */ + glColor4f(1.0f,1.0f,1.0f,1.0f); if(TskBuf[ship_id].tskid != 0){ pos[X] = TskBuf[id].px - TskBuf[ship_id].px / 16.0f; @@ -612,7 +617,7 @@ float[XY] base; float energy; - /* ボムゲージ描画 */ + z = BASE_Z - cam_pos; base[X] = TskBuf[id].tx; @@ -823,7 +828,7 @@ if(ship_lock == 0) return; - /* ターゲット描画 */ + z = BASE_Z - cam_pos; base[X] = scr_pos[X] - TskBuf[trg].px; base[Y] = scr_pos[Y] - TskBuf[trg].py; @@ -850,7 +855,7 @@ lx = 24.0f * TskBuf[id].sx; ly = 24.0f * TskBuf[id].sx; glBegin(GL_LINES); - /* 左下 */ + glVertex3f(getPointX(base[X]-size, 0.0f), getPointY(base[Y]-size+ly, 0.0f), z); @@ -863,7 +868,7 @@ glVertex3f(getPointX(base[X]-size+lx, 0.0f), getPointY(base[Y]-size, 0.0f), z); - /* 左上 */ + glVertex3f(getPointX(base[X]-size, 0.0f), getPointY(base[Y]+size-ly, 0.0f), z); @@ -876,7 +881,7 @@ glVertex3f(getPointX(base[X]-size+lx, 0.0f), getPointY(base[Y]+size, 0.0f), z); - /* 右下 */ + glVertex3f(getPointX(base[X]+size, 0.0f), getPointY(base[Y]-size+ly, 0.0f), z); @@ -889,7 +894,7 @@ glVertex3f(getPointX(base[X]+size-lx, 0.0f), getPointY(base[Y]-size, 0.0f), z); - /* 右上 */ + glVertex3f(getPointX(base[X]+size, 0.0f), getPointY(base[Y]+size-ly, 0.0f), z); @@ -902,7 +907,7 @@ glVertex3f(getPointX(base[X]+size-lx, 0.0f), getPointY(base[Y]+size, 0.0f), z); - /* クロス */ + glVertex3f(getPointX(base[X]-lx, 0.0f), getPointY(base[Y], 0.0f), z); diff -Naur a2k/a2k_src/src/task.d a2k-gentoo/a2k_src/src/task.d --- a2k/a2k_src/src/task.d 2004-09-05 17:54:26.000000000 +0200 +++ a2k-gentoo/a2k_src/src/task.d 2007-09-19 22:23:25.000000000 +0200 @@ -13,7 +13,7 @@ private import main; struct TSK { - /* システムメンバ */ + int tskid; int group; int entry; @@ -23,7 +23,7 @@ void function(int) fp_int; void function(int) fp_draw; void function(int) fp_exit; - /* アプリ依存メンバ */ + int step; int wait; int cnt; @@ -34,7 +34,7 @@ int wrk2; float fwrk1; float fwrk2; - /* ゲーム依存メンバ */ + int flag; int energy; int chr_id; @@ -75,7 +75,7 @@ float[XYZW][] line_ang; float[XYZW][] offset_ang; float alpha; - /* BulletMLメンバ */ + BulletCommand bullet_command; BulletMLState* bullet_state; int tid; @@ -126,7 +126,7 @@ void initTSK() { /* - // ワークの確保 + */ TskBuf.length = TSK_MAX; TskIndex.length = GROUP_MAX; @@ -138,7 +138,7 @@ TskEntry = 0; /* - // 空きリストの作成 + */ { int i; @@ -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; @@ -246,7 +248,7 @@ int prev; /* - // 全消去 + */ for(int i = 0; i < GROUP_MAX; i++){ for(int j = TskIndex[i]; j != -1; j = prev){ @@ -266,7 +268,7 @@ int prev; /* - // 全消去 + */ for(int i = TskIndex[group]; i != -1; i = prev){ prev = TskBuf[i].prev; @@ -286,7 +288,7 @@ TskCnt = 0; /* - // 実行 + */ for(int i = 0; i < GROUP_MAX; i++){ for(int j = TskIndex[i]; j != -1; j = prev){ @@ -311,7 +313,7 @@ int prev; /* - // 描画 + */ for(int i = 0; i < GROUP_MAX; i++){ for(int j = TskIndex[i]; j != -1; j = prev){ diff -Naur a2k/a2k_src/src/title.d a2k-gentoo/a2k_src/src/title.d --- a2k/a2k_src/src/title.d 2005-01-17 18:04:30.000000000 +0100 +++ a2k-gentoo/a2k_src/src/title.d 2007-09-19 22:23:25.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/a2k_src/src/util_ascii.d a2k-gentoo/a2k_src/src/util_ascii.d --- a2k/a2k_src/src/util_ascii.d 2004-07-20 17:45:48.000000000 +0200 +++ a2k-gentoo/a2k_src/src/util_ascii.d 2007-09-19 22:23:25.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/a2k_src/src/util_pad.d a2k-gentoo/a2k_src/src/util_pad.d --- a2k/a2k_src/src/util_pad.d 2004-09-15 16:52:28.000000000 +0200 +++ a2k-gentoo/a2k_src/src/util_pad.d 2007-09-19 22:23:25.000000000 +0200 @@ -7,7 +7,8 @@ */ private import SDL; - +private import SDL_Keysym; +private import SDL_keyboard; enum{ PAD_UP = 0x01, PAD_DOWN = 0x02, @@ -83,7 +84,7 @@ keys = SDL_GetKeyState(null); - /* 方向 */ + if(joys){ x = SDL_JoystickGetAxis(joys, 0); y = SDL_JoystickGetAxis(joys, 1); @@ -119,7 +120,7 @@ int btn1 = 0, btn2 = 0, btn3 = 0, btn4 = 0, btn5 = 0, btn6 = 0, btn7 = 0, btn8 = 0; - /* ボタン */ + if(joys){ btn1 = SDL_JoystickGetButton(joys, 0); btn2 = SDL_JoystickGetButton(joys, 1); @@ -153,12 +154,12 @@ } } - /* トリガ */ + pads_old = pads; pads = pad; trgs = pads & ~pads_old; - /* リピート */ + reps = 0; if(pads){ if(!trgs && !rep_cnt){ diff -Naur a2k/a2k_src/src/util_sdl.d a2k-gentoo/a2k_src/src/util_sdl.d --- a2k/a2k_src/src/util_sdl.d 2005-01-17 16:03:16.000000000 +0100 +++ a2k-gentoo/a2k_src/src/util_sdl.d 2007-09-19 22:23:25.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{ @@ -31,31 +34,44 @@ 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; -private int width = SCREEN_X; -private int height = SCREEN_Y; -private float nearPlane = 0.0f; -private float farPlane = 1000.0f; +private int width = SCREEN_X; +private int height = SCREEN_Y; +private float nearPlane = 0.0f; +private float farPlane = 1000.0f; +private GLuint TEXTURE_NONE = 0xffffffff; -private GLuint[] tex_bank; +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; + 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){ @@ -66,19 +82,20 @@ 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(PROJECT_NAME, null); + SDL_WM_SetCaption(PROJECT_NAME.ptr, null); + SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), null); return 1; -} - +} + void closeSDL() { for(int i = 0; i < SURFACE_MAX; i++){ @@ -95,9 +112,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]){ @@ -109,31 +126,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/a2k_src/src/util_snd.d a2k-gentoo/a2k_src/src/util_snd.d --- a2k/a2k_src/src/util_snd.d 2004-07-22 17:28:18.000000000 +0200 +++ a2k-gentoo/a2k_src/src/util_snd.d 2007-09-19 22:23:25.000000000 +0200 @@ -84,7 +84,7 @@ char[] fileName = name ~ "\0"; - music[ch] = Mix_LoadMUS(fileName); + music[ch] = Mix_LoadMUS(fileName.ptr); if(!music[ch]){ sound_use = false; } @@ -104,7 +104,7 @@ char[] fileName = name ~ "\0"; - chunk[bank] = Mix_LoadWAV(fileName); + chunk[bank] = Mix_LoadWAV(fileName.ptr); if(!chunk[bank]){ sound_use = false; } diff -Naur a2k/makefile a2k-gentoo/makefile --- a2k/makefile 1970-01-01 01:00:00.000000000 +0100 +++ a2k-gentoo/makefile 2007-09-19 22:23:25.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 +