X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
Revision | 234 (tree) |
---|---|
Zeit | 2020-02-24 19:28:55 |
Autor | xops-mikan |
メニューのオプション画面にライセンス情報を表示する機能追加、スクロールバー処理のバグ修正、"help"コマンドによるリスト表示改善
@@ -57,6 +57,7 @@ | ||
57 | 57 | |
58 | 58 | //ptextsprite = NULL; |
59 | 59 | pxmsfont = NULL; |
60 | + pxmssmallfont = NULL; | |
60 | 61 | TextureFont = -1; |
61 | 62 | |
62 | 63 | #ifdef ENABLE_DEBUGCONSOLE |
@@ -336,9 +337,17 @@ | ||
336 | 337 | return 1; |
337 | 338 | } |
338 | 339 | //フォント名:MS ゴシック サイズ:18 |
339 | - HRESULT hr = D3DXCreateFont( pd3dDevice, -18, 0, FW_NORMAL, 1, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, | |
340 | - DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "MS ゴシック", &pxmsfont); | |
341 | - if( FAILED(hr) ){ return 1; } | |
340 | + if( FAILED( D3DXCreateFont( pd3dDevice, -18, 0, FW_NORMAL, 1, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, | |
341 | + DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "MS ゴシック", &pxmsfont) ) | |
342 | + ){ | |
343 | + return 1; | |
344 | + } | |
345 | + //フォント名:MS ゴシック サイズ:12 | |
346 | + if( FAILED( D3DXCreateFont( pd3dDevice, -12, 0, FW_NORMAL, 1, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, | |
347 | + DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "MS ゴシック", &pxmssmallfont) ) | |
348 | + ){ | |
349 | + return 1; | |
350 | + } | |
342 | 351 | |
343 | 352 | //テクスチャフォント用画像を取得 |
344 | 353 | TextureFont = LoadTexture(TextureFontFname, true, false); |
@@ -368,6 +377,10 @@ | ||
368 | 377 | pxmsfont->Release(); |
369 | 378 | pxmsfont = NULL; |
370 | 379 | } |
380 | + if( pxmssmallfont != NULL ){ | |
381 | + pxmssmallfont->Release(); | |
382 | + pxmssmallfont = NULL; | |
383 | + } | |
371 | 384 | if( ptextsprite != NULL ){ |
372 | 385 | ptextsprite->Release(); |
373 | 386 | ptextsprite = NULL; |
@@ -1569,6 +1582,32 @@ | ||
1569 | 1582 | End2DMSFontTextRender(); |
1570 | 1583 | } |
1571 | 1584 | |
1585 | +//! @brief 文字を表示(システムフォント使用、小さい) | |
1586 | +//! @param x x座標 | |
1587 | +//! @param y y座標 | |
1588 | +//! @param str 文字列 (改行コード:可) | |
1589 | +//! @param color 色 | |
1590 | +//! @note 基本仕様はDraw2DMSFontText()と同等ですが、文字が小さくなります。 | |
1591 | +void D3DGraphics::Draw2DMSSmallFontText(int x, int y, char *str, int color) | |
1592 | +{ | |
1593 | + //if( ptextsprite == NULL ){ return; } | |
1594 | + | |
1595 | + //テキストスプライト初期化 | |
1596 | + Start2DMSFontTextRender(); | |
1597 | + | |
1598 | + //基準座標を設定 | |
1599 | + D3DXMATRIX matWorld; | |
1600 | + D3DXMatrixIdentity(&matWorld); | |
1601 | + ptextsprite->SetTransform(&matWorld); | |
1602 | + | |
1603 | + //文字を表示 | |
1604 | + RECT rc = {x, y, 0, 0}; | |
1605 | + pxmssmallfont->DrawText(ptextsprite, str, -1, &rc, DT_NOCLIP, color); | |
1606 | + | |
1607 | + //テキストスプライト解放 | |
1608 | + End2DMSFontTextRender(); | |
1609 | +} | |
1610 | + | |
1572 | 1611 | //! @brief 2D システムフォントによるテキスト表示を終了 |
1573 | 1612 | //! @attention DirectXの ID3DXSprite を解放しています。 |
1574 | 1613 | void D3DGraphics::End2DMSFontTextRender() |
@@ -55,6 +55,7 @@ | ||
55 | 55 | height = 0; |
56 | 56 | fullscreenflag = false; |
57 | 57 | SystemFont = NULL; |
58 | + SystemSmallFont = NULL; | |
58 | 59 | now_SystemFontUStr = new WCHAR [1]; |
59 | 60 | now_SystemFontUStr[0] = NULL; |
60 | 61 | SystemFontListIdx = 0; |
@@ -187,6 +188,8 @@ | ||
187 | 188 | //システムフォント用意 |
188 | 189 | //フォント名:MS ゴシック サイズ:18 |
189 | 190 | SystemFont = CreateFont(18, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "MS ゴシック"); |
191 | + //フォント名:MS ゴシック サイズ:12 | |
192 | + SystemSmallFont = CreateFont(12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "MS ゴシック"); | |
190 | 193 | |
191 | 194 | #ifdef ENABLE_DEBUGLOG |
192 | 195 | //ログに出力 |
@@ -314,6 +317,8 @@ | ||
314 | 317 | //システムフォント用意 |
315 | 318 | //フォント名:MS ゴシック サイズ:18 |
316 | 319 | SystemFont = CreateFont(18, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "MS ゴシック"); |
320 | + //フォント名:MS ゴシック サイズ:12 | |
321 | + SystemSmallFont = CreateFont(12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "MS ゴシック"); | |
317 | 322 | |
318 | 323 | #ifdef ENABLE_DEBUGLOG |
319 | 324 | //ログに出力 |
@@ -380,6 +385,10 @@ | ||
380 | 385 | DeleteObject(SystemFont); |
381 | 386 | SystemFont = NULL; |
382 | 387 | } |
388 | + if( SystemSmallFont != NULL ){ | |
389 | + DeleteObject(SystemSmallFont); | |
390 | + SystemSmallFont = NULL; | |
391 | + } | |
383 | 392 | if( now_SystemFontUStr != NULL ){ |
384 | 393 | delete [] now_SystemFontUStr; |
385 | 394 | now_SystemFontUStr = NULL; |
@@ -2417,6 +2426,87 @@ | ||
2417 | 2426 | Draw2DMSFontText(x + (w/2 - (StrMaxLineLen(str)*9/2)), y, str, color); |
2418 | 2427 | } |
2419 | 2428 | |
2429 | +//! @brief 文字を表示(システムフォント使用、小さい) | |
2430 | +//! @param x x座標 | |
2431 | +//! @param y y座標 | |
2432 | +//! @param str 文字列 (改行コード:可) | |
2433 | +//! @param color 色 | |
2434 | +//! @note 基本仕様はDraw2DMSFontText()と同等ですが、文字が小さくなります。 | |
2435 | +//! @todo 同一文字列を通常フォントサイズで出すとバグが出るかもしれない。(要検証) | |
2436 | +void D3DGraphics::Draw2DMSSmallFontText(int x, int y, char *str, int color) | |
2437 | +{ | |
2438 | + int len = strlen(str); | |
2439 | + WCHAR *ustr; | |
2440 | + | |
2441 | + y += 12; | |
2442 | + | |
2443 | + Start2DRender(); | |
2444 | + glEnable(GL_DEPTH_TEST); | |
2445 | + | |
2446 | + //テクスチャ無効 | |
2447 | + glDisable(GL_TEXTURE_2D); | |
2448 | + | |
2449 | + //Unicode文字列へ変換 | |
2450 | + ustr = new WCHAR [len+1]; | |
2451 | + MultiByteToWideChar(CP_ACP, 0, str, -1, ustr, len + 1); | |
2452 | + | |
2453 | + //新たな文字列なら、リソースを作り直す | |
2454 | + if( lstrcmpW(ustr, now_SystemFontUStr) != 0 ){ | |
2455 | + GLuint listIdx; | |
2456 | + HDC hDC; | |
2457 | + | |
2458 | + //古いデータを削除 | |
2459 | + glDeleteLists(SystemFontListIdx, SystemFontListIdxSize); | |
2460 | + delete [] now_SystemFontUStr; | |
2461 | + | |
2462 | + //デバイスコンテキスト設定 | |
2463 | + hDC = GetDC(hWnd); | |
2464 | + wglMakeCurrent(hDC, hGLRC); | |
2465 | + SelectObject(hDC, SystemSmallFont); | |
2466 | + | |
2467 | + //ディスプレイリストを作成 | |
2468 | + listIdx = glGenLists(len); | |
2469 | + wglUseFontBitmapsW(hDC, ustr[0], 1, listIdx); //ダミー | |
2470 | + for(int i=0; i<lstrlenW(ustr); i++){ | |
2471 | + wglUseFontBitmapsW(hDC, ustr[i], 1, listIdx+i); | |
2472 | + } | |
2473 | + | |
2474 | + //デバイスコンテキスト廃棄 | |
2475 | + ReleaseDC(hWnd, hDC); | |
2476 | + | |
2477 | + //設定を記録 | |
2478 | + now_SystemFontUStr = new WCHAR [len+1]; | |
2479 | + lstrcpyW(now_SystemFontUStr, ustr); | |
2480 | + SystemFontListIdx = listIdx; | |
2481 | + SystemFontListIdxSize = len; | |
2482 | + } | |
2483 | + | |
2484 | + //座標と色を設定 | |
2485 | + glBitmap(0, 0, 0, 0, 10, 0, NULL); | |
2486 | + glRasterPos3f((float)x, (float)y, SystemFont_posz); | |
2487 | + glColor4ub((color>>24)&0xFF, (color>>16)&0xFF, (color>>8)&0xFF, color&0xFF); | |
2488 | + | |
2489 | + for(int i=0; i<lstrlenW(ustr); i++){ | |
2490 | + if( ustr[i] == '\n' ){ | |
2491 | + //改行する | |
2492 | + y += 12; | |
2493 | + glRasterPos3f((float)x, (float)y, SystemFont_posz); | |
2494 | + } | |
2495 | + else{ | |
2496 | + //ディスプレイリスト描画 | |
2497 | + glCallList(SystemFontListIdx + i); | |
2498 | + } | |
2499 | + } | |
2500 | + | |
2501 | + SystemFont_posz -= 0.01f; | |
2502 | + | |
2503 | + //Unicode文字列の廃棄 | |
2504 | + delete [] ustr; | |
2505 | + | |
2506 | + //glDisable(GL_DEPTH_TEST); | |
2507 | + End2DRender(); | |
2508 | +} | |
2509 | + | |
2420 | 2510 | //! @brief 2D描画用設定 |
2421 | 2511 | void D3DGraphics::Start2DRender() |
2422 | 2512 | { |
@@ -185,6 +185,7 @@ | ||
185 | 185 | |
186 | 186 | LPD3DXSPRITE ptextsprite; //!< 2Dテクスチャスプライト |
187 | 187 | LPD3DXFONT pxmsfont; //!< システムフォント |
188 | + LPD3DXFONT pxmssmallfont; //!< システムフォント(小さい) | |
188 | 189 | char TextureFontFname[_MAX_PATH]; //!< テクスチャフォントのファイル名 |
189 | 190 | int TextureFont; //!< テクスチャフォントのテクスチャID |
190 | 191 |
@@ -214,6 +215,7 @@ | ||
214 | 215 | TEXTUREDATA ptextures[MAX_TEXTURE]; //!< テクスチャを格納 |
215 | 216 | GLuint textureobjname[MAX_TEXTURE]; //!< テクスチャオブジェクト |
216 | 217 | HFONT SystemFont; //!< システムフォント用の論理フォント |
218 | + HFONT SystemSmallFont; //!< システムフォント用の論理フォント(小さい) | |
217 | 219 | WCHAR *now_SystemFontUStr; //!< 現在表示中のシステムフォントによる文字列(Unicode) |
218 | 220 | GLuint SystemFontListIdx; //!< システムフォントのディスプレイリスト |
219 | 221 | int SystemFontListIdxSize; //!< システムフォントのディスプレイリストのサイズ |
@@ -301,6 +303,7 @@ | ||
301 | 303 | void Renderline(float x1, float y1, float z1, float x2, float y2, float z2, int color); |
302 | 304 | void Draw2DMSFontText(int x, int y, char *str, int color); |
303 | 305 | void Draw2DMSFontTextCenter(int x, int y, int w, int h, char *str, int color); |
306 | + void Draw2DMSSmallFontText(int x, int y, char *str, int color); | |
304 | 307 | void Draw2DTextureFontText(int x, int y, char *str, int color, int fontwidth, int fontheight); |
305 | 308 | void Draw2DTextureFontTextCenter(int x, int y, char *str, int color, int fontwidth, int fontheight); |
306 | 309 | #ifdef ENABLE_DEBUGCONSOLE |
@@ -28,6 +28,7 @@ | ||
28 | 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
29 | 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 | //-------------------------------------------------------------------------------- |
31 | +// ※メニュー内のライセンス文章は mainmenu::CreateOptions() 内で定義されている。 | |
31 | 32 | |
32 | 33 | #include "gamemain.h" |
33 | 34 |
@@ -453,11 +454,23 @@ | ||
453 | 454 | mainmenu::mainmenu() |
454 | 455 | { |
455 | 456 | demopath[0] = '\0'; |
457 | + | |
458 | +#ifdef ENABLE_MENUOPTIONS | |
459 | + licenseinfobuf = new char[100*18]; | |
460 | + licenseinfobuf[0] = '\0'; | |
461 | +#endif | |
456 | 462 | } |
457 | 463 | |
458 | 464 | //! @brief ディストラクタ |
459 | 465 | mainmenu::~mainmenu() |
460 | -{} | |
466 | +{ | |
467 | +#ifdef ENABLE_MENUOPTIONS | |
468 | + if( licenseinfobuf != NULL ){ | |
469 | + delete [] licenseinfobuf; | |
470 | + licenseinfobuf = NULL; | |
471 | + } | |
472 | +#endif | |
473 | +} | |
461 | 474 | |
462 | 475 | int mainmenu::Create() |
463 | 476 | { |
@@ -910,13 +923,13 @@ | ||
910 | 923 | Options_p1LinkTextData[0].text_defaultcolor = d3dg->GetColorCode(0.6f,0.6f,1.0f,1.0f); |
911 | 924 | Options_p1LinkTextData[0].text_cursorcolor = d3dg->GetColorCode(1.0f,0.6f,0.6f,1.0f); |
912 | 925 | strcpy(Options_p1LinkTextData[0].text, "CONFIG"); |
913 | - Options_p1LinkTextData[1].enable = false; | |
926 | + Options_p1LinkTextData[1].enable = true; | |
914 | 927 | Options_p1LinkTextData[1].pos_x = 0; |
915 | 928 | Options_p1LinkTextData[1].pos_y = 90; |
916 | 929 | Options_p1LinkTextData[1].text_w = 20; |
917 | 930 | Options_p1LinkTextData[1].text_h = 26; |
918 | - Options_p1LinkTextData[1].text_defaultcolor = 0x00000000; | |
919 | - Options_p1LinkTextData[1].text_cursorcolor = 0x00000000; | |
931 | + Options_p1LinkTextData[1].text_defaultcolor = d3dg->GetColorCode(0.6f,0.6f,1.0f,1.0f); | |
932 | + Options_p1LinkTextData[1].text_cursorcolor = d3dg->GetColorCode(1.0f,0.6f,0.6f,1.0f); | |
920 | 933 | strcpy(Options_p1LinkTextData[1].text, "SOFTWARE LICENSE"); |
921 | 934 | Options_p1LinkTextData[2].enable = true; |
922 | 935 | Options_p1LinkTextData[2].pos_x = 0; |
@@ -1001,6 +1014,58 @@ | ||
1001 | 1014 | Options_p2LinkTextData[14 + i].text_cursorcolor = d3dg->GetColorCode(1.0f,0.6f,0.6f,1.0f); |
1002 | 1015 | strcpy(Options_p2LinkTextData[14 + i].text, "[ ]"); |
1003 | 1016 | } |
1017 | + | |
1018 | + Options_p3LinkTextData[0].enable = true; | |
1019 | + Options_p3LinkTextData[0].pos_x = (OPTIONS_P3_W - 160)/2; | |
1020 | + Options_p3LinkTextData[0].pos_y = OPTIONS_P3_H - 35; | |
1021 | + Options_p3LinkTextData[0].text_w = 20; | |
1022 | + Options_p3LinkTextData[0].text_h = 26; | |
1023 | + Options_p3LinkTextData[0].text_defaultcolor = d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f); | |
1024 | + Options_p3LinkTextData[0].text_cursorcolor = d3dg->GetColorCode(0.0f,1.0f,1.0f,1.0f); | |
1025 | + strcpy(Options_p3LinkTextData[0].text, "< EXIT >"); | |
1026 | + | |
1027 | + scrollbar_license.Create(OPTIONS_P3_X + OPTIONS_P3_W - 20, OPTIONS_P3_Y+55, 20, 18*12, OPTIONS_LICENSELINE, 18, 0); | |
1028 | + scrollbar_license.SetColor(d3dg->GetColorCode(0.5f,0.5f,0.5f,0.5f), d3dg->GetColorCode(0.6f,0.6f,0.25f,1.0f), d3dg->GetColorCode(0.8f,0.8f,0.25f,1.0f), | |
1029 | + d3dg->GetColorCode(0.4f,0.67f,0.57f,1.0f), d3dg->GetColorCode(0.38f,0.77f,0.64f,1.0f), d3dg->GetColorCode(0.6f,0.3f,0.25f,1.0f), d3dg->GetColorCode(0.8f,0.3f,0.25f,1.0f)); | |
1030 | + | |
1031 | +#ifndef ENABLE_GRAPHICS_OPENGL | |
1032 | + //ライセンス文章 | |
1033 | + licenseinfo[0] = ""; | |
1034 | + licenseinfo[1] = "OpenXOPS"; | |
1035 | + licenseinfo[2] = "Copyright (c) 2014-2020, OpenXOPS Project / [-_-;](mikan) All rights reserved."; | |
1036 | + licenseinfo[3] = ""; | |
1037 | + licenseinfo[4] = "Redistribution and use in source and binary forms, with or without"; | |
1038 | + licenseinfo[5] = "modification, are permitted provided that the following conditions are met:"; | |
1039 | + licenseinfo[6] = "* Redistributions of source code must retain the above copyright notice, "; | |
1040 | + licenseinfo[7] = " this list of conditions and the following disclaimer."; | |
1041 | + licenseinfo[8] = "* Redistributions in binary form must reproduce the above copyright notice, "; | |
1042 | + licenseinfo[9] = " this list of conditions and the following disclaimer in the documentation "; | |
1043 | + licenseinfo[10] = " and/or other materials provided with the distribution."; | |
1044 | + licenseinfo[11] = "* Neither the name of the OpenXOPS Project nor the names of its contributors "; | |
1045 | + licenseinfo[12] = " may be used to endorse or promote products derived from this software "; | |
1046 | + licenseinfo[13] = " without specific prior written permission."; | |
1047 | + licenseinfo[14] = ""; | |
1048 | + licenseinfo[15] = "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND"; | |
1049 | + licenseinfo[16] = "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"; | |
1050 | + licenseinfo[17] = "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"; | |
1051 | + licenseinfo[18] = "DISCLAIMED. IN NO EVENT SHALL OpenXOPS Project BE LIABLE FOR ANY"; | |
1052 | + licenseinfo[19] = "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"; | |
1053 | + licenseinfo[20] = "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"; | |
1054 | + licenseinfo[21] = "LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"; | |
1055 | + licenseinfo[22] = "ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"; | |
1056 | + licenseinfo[23] = "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"; | |
1057 | + licenseinfo[24] = "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."; | |
1058 | + licenseinfo[25] = ""; | |
1059 | + //行数追加時 "OPTIONS_LICENSELINE"定数 要変更 | |
1060 | +#else //ENABLE_GRAPHICS_OPENGL | |
1061 | + licenseinfo[0] = ""; | |
1062 | + licenseinfo[1] = "OpenXOPS"; | |
1063 | + licenseinfo[2] = "Copyright (c) 2014-2020, OpenXOPS Project / [-_-;](mikan) All rights reserved."; | |
1064 | + licenseinfo[3] = ""; | |
1065 | + licenseinfo[4] = " -- See the document."; | |
1066 | + licenseinfo[5] = ""; | |
1067 | + //※OpenGLの場合、スクロール必要な分量を出すとチラつくので注意。 | |
1068 | +#endif //ENABLE_GRAPHICS_OPENGL | |
1004 | 1069 | } |
1005 | 1070 | |
1006 | 1071 | //! @brief オプション画面の入力処理 |
@@ -1025,9 +1090,13 @@ | ||
1025 | 1090 | if( ButtonID == 0 ){ |
1026 | 1091 | modescreen = 2; |
1027 | 1092 | } |
1028 | - //if( ButtonID == 1 ){ | |
1029 | - // | |
1030 | - //} | |
1093 | + if( ButtonID == 1 ){ | |
1094 | + modescreen = 3; | |
1095 | + | |
1096 | + //ライセンス文のスクロールバーを一番上にセット | |
1097 | + scrollbar_license.SetScrollItem(0); | |
1098 | + scrollbar_license.Input(0, 0, false, 0); | |
1099 | + } | |
1031 | 1100 | if( ButtonID == 2 ){ |
1032 | 1101 | modescreen = 0; |
1033 | 1102 | } |
@@ -1069,6 +1138,31 @@ | ||
1069 | 1138 | Options_p2LinkTextID = 2; |
1070 | 1139 | } |
1071 | 1140 | } |
1141 | + | |
1142 | + else if( modescreen == 3 ){ | |
1143 | + scrollbar_license.Input(mainmenu_mouseX, mainmenu_mouseY, inputCtrl->CheckMouseButtonNowL(), mainmenu_mouseY - mainmenu_mouseY_old); | |
1144 | + | |
1145 | + //リンクテキスト判定処理 | |
1146 | + int ButtonID = -1; | |
1147 | + for(int i=0; i<OPTIONS_P3_DATAS; i++){ | |
1148 | + if( Options_p3LinkTextData[i].enable == true ){ | |
1149 | + if( inputCtrl->CheckMouseButtonUpL() ){ | |
1150 | + if( ((OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x) < mainmenu_mouseX)&&(mainmenu_mouseX < (OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x + (signed)strlen(Options_p3LinkTextData[i].text)*Options_p3LinkTextData[i].text_w)) | |
1151 | + &&((OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y) < mainmenu_mouseY)&&(mainmenu_mouseY < (OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y + Options_p3LinkTextData[i].text_h)) | |
1152 | + ){ | |
1153 | + ButtonID = i; | |
1154 | + } | |
1155 | + } | |
1156 | + } | |
1157 | + } | |
1158 | + if( ButtonID == 0 ){ | |
1159 | + modescreen = 1; | |
1160 | + } | |
1161 | + | |
1162 | + if( inputCtrl->CheckKeyDown(GetEscKeycode()) ){ //ESCキーを処理 | |
1163 | + modescreen = 1; | |
1164 | + } | |
1165 | + } | |
1072 | 1166 | } |
1073 | 1167 | |
1074 | 1168 | //! @brief オプション画面のメイン処理 |
@@ -1349,6 +1443,58 @@ | ||
1349 | 1443 | } |
1350 | 1444 | } |
1351 | 1445 | } |
1446 | + | |
1447 | + if( modescreen == 3 ){ | |
1448 | + int color; | |
1449 | + | |
1450 | + //エリア描画 | |
1451 | + d3dg->Draw2DBox(OPTIONS_P3_X, OPTIONS_P3_Y, OPTIONS_P3_X + OPTIONS_P3_W, OPTIONS_P3_Y + OPTIONS_P3_H, d3dg->GetColorCode(0.0f,0.0f,0.0f,0.5f)); | |
1452 | + | |
1453 | + d3dg->Draw2DTextureFontText(OPTIONS_P3_X + 0 +1, OPTIONS_P3_Y + 15 +1, "SOFTWARE LICENSE", d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f), 18, 24); | |
1454 | + d3dg->Draw2DTextureFontText(OPTIONS_P3_X + 0, OPTIONS_P3_Y + 15, "SOFTWARE LICENSE", d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), 18, 24); | |
1455 | + | |
1456 | + d3dg->Draw2DBox(OPTIONS_P3_X + 0, OPTIONS_P3_Y + 55, OPTIONS_P3_X + OPTIONS_P3_W-20, OPTIONS_P3_Y + 55 + 18*12, d3dg->GetColorCode(0.0f,0.0f,0.0f,0.7f)); | |
1457 | + | |
1458 | + //ライセンス文描画 | |
1459 | + int scrollline = scrollbar_license.GetScrollItem(); | |
1460 | + strcpy(licenseinfobuf, ""); | |
1461 | +#if OPTIONS_LICENSELINE > 18 | |
1462 | + for(int i=0; i<18; i++){ | |
1463 | +#else | |
1464 | + for(int i=0; i<OPTIONS_LICENSELINE; i++){ | |
1465 | +#endif | |
1466 | + strcat(licenseinfobuf, licenseinfo[scrollline + i]); | |
1467 | + strcat(licenseinfobuf, "\n"); | |
1468 | + } | |
1469 | + d3dg->Draw2DMSSmallFontText(OPTIONS_P3_X + 5, OPTIONS_P3_Y+55, licenseinfobuf, d3dg->GetColorCode(0.8f,0.8f,0.8f,1.0f)); | |
1470 | + | |
1471 | + //スクロールバー描画 | |
1472 | + scrollbar_license.Draw(d3dg); | |
1473 | + | |
1474 | + for(int i=0; i<OPTIONS_P3_DATAS; i++){ | |
1475 | + if( Options_p3LinkTextData[i].enable == true ){ | |
1476 | + //文字の色を設定 | |
1477 | + if( ((OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x) < mainmenu_mouseX)&&(mainmenu_mouseX < (OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x + (signed)strlen(Options_p3LinkTextData[i].text)*Options_p3LinkTextData[i].text_w)) | |
1478 | + &&((OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y) < mainmenu_mouseY)&&(mainmenu_mouseY < (OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y + Options_p3LinkTextData[i].text_h)) | |
1479 | + ){ | |
1480 | + color = Options_p3LinkTextData[i].text_cursorcolor; | |
1481 | + } | |
1482 | + else{ | |
1483 | + color = Options_p3LinkTextData[i].text_defaultcolor; | |
1484 | + } | |
1485 | + | |
1486 | + //文字を表示 | |
1487 | + d3dg->Draw2DTextureFontText(OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x +1, OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y +1, Options_p3LinkTextData[i].text, | |
1488 | + d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f), Options_p3LinkTextData[i].text_w, Options_p3LinkTextData[i].text_h); | |
1489 | + d3dg->Draw2DTextureFontText(OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x, OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y, Options_p3LinkTextData[i].text, | |
1490 | + color, Options_p3LinkTextData[i].text_w, Options_p3LinkTextData[i].text_h); | |
1491 | + } | |
1492 | + else{ | |
1493 | + d3dg->Draw2DTextureFontText(OPTIONS_P3_X + Options_p3LinkTextData[i].pos_x, OPTIONS_P3_Y + Options_p3LinkTextData[i].pos_y, Options_p3LinkTextData[i].text, | |
1494 | + d3dg->GetColorCode(0.6f,0.6f,0.6f,1.0f), Options_p3LinkTextData[i].text_w, Options_p3LinkTextData[i].text_h); | |
1495 | + } | |
1496 | + } | |
1497 | + } | |
1352 | 1498 | } |
1353 | 1499 | #endif //ENABLE_MENUOPTIONS |
1354 | 1500 |
@@ -3326,7 +3472,7 @@ | ||
3326 | 3472 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM> dark fog"); |
3327 | 3473 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "player <NUM> revive kill <NUM> treat <NUM> nodamage <NUM>"); |
3328 | 3474 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "newobj <NUM> break <NUM> delhuman <NUM> delweapon <NUM> delobj <NUL>"); |
3329 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "nofight caution ailevel <NUM> ff bot stop estop"); | |
3475 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "nofight caution ailevel <NUM> ff bot stop estop"); | |
3330 | 3476 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "speed window ss clear exit"); |
3331 | 3477 | } |
3332 | 3478 |
@@ -69,7 +69,7 @@ | ||
69 | 69 | #include "main.h" |
70 | 70 | |
71 | 71 | #ifdef ENABLE_MENUOPTIONS |
72 | - #define OPTIONS_P1_W 360 //!< オプション画面 No.1 幅 | |
72 | + #define OPTIONS_P1_W 340 //!< オプション画面 No.1 幅 | |
73 | 73 | #define OPTIONS_P1_H (30*6) //!< オプション画面 No.1 高さ |
74 | 74 | #define OPTIONS_P1_X (SCREEN_WIDTH - 360) //!< オプション画面 No.1 X座標 |
75 | 75 | #define OPTIONS_P1_Y (MAINMENU_Y+MAINMENU_H - OPTIONS_P1_H - 24) //!< オプション画面 No.1 Y座標 |
@@ -79,6 +79,16 @@ | ||
79 | 79 | #define OPTIONS_P2_X ((SCREEN_WIDTH - OPTIONS_P2_W)/2) //!< オプション画面 No.2 X座標 |
80 | 80 | #define OPTIONS_P2_Y (105 + (SCREEN_HEIGHT-105 - OPTIONS_P2_H)/2) //!< オプション画面 No.2 Y座標 |
81 | 81 | #define OPTIONS_P2_DATAS 32 //!< オプション画面 No.2 リンクテキストの数 |
82 | + #define OPTIONS_P3_W 600 //!< オプション画面 No.3 幅 | |
83 | + #define OPTIONS_P3_H 320 //!< オプション画面 No.3 高さ | |
84 | + #define OPTIONS_P3_X ((SCREEN_WIDTH - OPTIONS_P3_W)/2) //!< オプション画面 No.3 X座標 | |
85 | + #define OPTIONS_P3_Y (105 + (SCREEN_HEIGHT-105 - OPTIONS_P3_H)/2) //!< オプション画面 No.3 Y座標 | |
86 | + #define OPTIONS_P3_DATAS 1 //!< オプション画面 No.3 リンクテキストの数 | |
87 | +#ifndef ENABLE_GRAPHICS_OPENGL | |
88 | + #define OPTIONS_LICENSELINE 26 //!< ライセンス文の行数 | |
89 | +#else //ENABLE_GRAPHICS_OPENGL | |
90 | + #define OPTIONS_LICENSELINE 6 //!< ライセンス文の行数 | |
91 | +#endif //ENABLE_GRAPHICS_OPENGL | |
82 | 92 | #endif //ENABLE_MENUOPTIONS |
83 | 93 | |
84 | 94 | #ifdef ENABLE_DEBUGCONSOLE |
@@ -162,10 +172,14 @@ | ||
162 | 172 | #ifdef ENABLE_MENUOPTIONS |
163 | 173 | MenuLinkTextData Options_p1LinkTextData[OPTIONS_P1_DATAS]; //!< オプション画面 No.1 リンクテキストデータ |
164 | 174 | MenuLinkTextData Options_p2LinkTextData[OPTIONS_P2_DATAS]; //!< オプション画面 No.2 リンクテキストデータ |
165 | - int Options_p2LinkTextID; //!< オプション画面 No.2 押されたリンクテキストのID | |
166 | - bool Options_FullscreenFlag_old; //!< オプション画面 No.2 フルスクリーンフラグ | |
167 | - int Options_KeyConfigID; //!< オプション画面 No.2 キー設定ID | |
168 | - int Options_KeyConfigCnt; //!< オプション画面 No.2 キー設定カウント(フレーム数) | |
175 | + MenuLinkTextData Options_p3LinkTextData[OPTIONS_P3_DATAS]; //!< オプション画面 No.3 リンクテキストデータ | |
176 | + class ScrollbarObject scrollbar_license; //!< ライセンス文のスクロールバー | |
177 | + int Options_p2LinkTextID; //!< オプション画面 No.2 押されたリンクテキストのID | |
178 | + bool Options_FullscreenFlag_old; //!< オプション画面 No.2 フルスクリーンフラグ | |
179 | + int Options_KeyConfigID; //!< オプション画面 No.2 キー設定ID | |
180 | + int Options_KeyConfigCnt; //!< オプション画面 No.2 キー設定カウント(フレーム数) | |
181 | + char *licenseinfo[OPTIONS_LICENSELINE]; //!< ライセンス文 | |
182 | + char *licenseinfobuf; | |
169 | 183 | #endif //ENABLE_MENUOPTIONS |
170 | 184 | |
171 | 185 | void Render3D(); |
@@ -108,7 +108,7 @@ | ||
108 | 108 | //! @param id アイテム数 |
109 | 109 | void ScrollbarObject::SetScrollItem(int id) |
110 | 110 | { |
111 | - if( (id < 0)||(id <= totalitems) ){ return; } | |
111 | + if( (id < 0)||(totalitems <= id) ){ return; } | |
112 | 112 | |
113 | 113 | scrollitem = id; |
114 | 114 | } |