X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 335 (tree) |
|---|---|
| Time | 2022-10-21 00:20:52 |
| Author | |
OpenGLにおけるスクリーンショット保存時のbmpフォーマットを改善、DirectXのデバック用フォント読み込み処理を改善
| @@ -791,8 +791,8 @@ | ||
| 791 | 791 | Set4ByteLittleEndian(&(bmpdata[0x02]), bufsize); |
| 792 | 792 | bmpdata[0x0A] = (unsigned char)headersize; |
| 793 | 793 | bmpdata[0x0E] = (unsigned char)(headersize - 14); |
| 794 | - bmpdata[0x12] = (unsigned char)width; | |
| 795 | - bmpdata[0x16] = (unsigned char)height; | |
| 794 | + Set4ByteLittleEndian(&(bmpdata[0x12]), width); | |
| 795 | + Set4ByteLittleEndian(&(bmpdata[0x16]), height); | |
| 796 | 796 | bmpdata[0x1A] = 1; |
| 797 | 797 | bmpdata[0x1C] = 24; |
| 798 | 798 | bmpdata[0x1E] = 0; |
| @@ -3210,15 +3210,18 @@ | ||
| 3210 | 3210 | } |
| 3211 | 3211 | |
| 3212 | 3212 | //ヘッダーを生成 |
| 3213 | - for(int i=0; i<54; i++){ | |
| 3214 | - header[i] = 0x00; | |
| 3215 | - } | |
| 3213 | + for(int i=0; i<54; i++){ header[i] = 0x00; } | |
| 3216 | 3214 | header[0x00] = 'B'; |
| 3217 | 3215 | header[0x01] = 'M'; |
| 3218 | - header[0x0E] = 40; | |
| 3216 | + Set4ByteLittleEndian(&(header[0x02]), 54 + GameConfig.GetScreenWidth()*GameConfig.GetScreenHeight()*3); | |
| 3217 | + header[0x0A] = 54; | |
| 3218 | + header[0x0E] = 54 - 14; | |
| 3219 | 3219 | Set4ByteLittleEndian(&(header[0x12]), GameConfig.GetScreenWidth()); |
| 3220 | 3220 | Set4ByteLittleEndian(&(header[0x16]), GameConfig.GetScreenHeight()); |
| 3221 | + header[0x1A] = 1; | |
| 3221 | 3222 | header[0x1C] = 24; |
| 3223 | + header[0x1E] = 0; | |
| 3224 | + Set4ByteLittleEndian(&(header[0x22]), GameConfig.GetScreenWidth()*GameConfig.GetScreenHeight()*3); | |
| 3222 | 3225 | |
| 3223 | 3226 | //ヘッダーを書き込む |
| 3224 | 3227 | fwrite(header, 1, 54, fp); |
| @@ -3231,6 +3234,15 @@ | ||
| 3231 | 3234 | |
| 3232 | 3235 | fwrite(&pixel, 1, 3, fp); |
| 3233 | 3236 | } |
| 3237 | + | |
| 3238 | + if( (GameConfig.GetScreenWidth()%4) != 0 ){ | |
| 3239 | + //4の倍数になるようにパディング | |
| 3240 | + unsigned char dummy[3]; | |
| 3241 | + dummy[0] = 0x00; | |
| 3242 | + dummy[1] = 0x00; | |
| 3243 | + dummy[2] = 0x00; | |
| 3244 | + fwrite(&dummy, 1, 4 - (GameConfig.GetScreenWidth()%4), fp); | |
| 3245 | + } | |
| 3234 | 3246 | } |
| 3235 | 3247 | |
| 3236 | 3248 | //ファイルハンドルを解放 |