• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision335 (tree)
Time2022-10-21 00:20:52
Authorxops-mikan

Log Message

OpenGLにおけるスクリーンショット保存時のbmpフォーマットを改善、DirectXのデバック用フォント読み込み処理を改善

Change Summary

Incremental Difference

--- trunk/d3dgraphics-directx.cpp (revision 334)
+++ trunk/d3dgraphics-directx.cpp (revision 335)
@@ -791,8 +791,8 @@
791791 Set4ByteLittleEndian(&(bmpdata[0x02]), bufsize);
792792 bmpdata[0x0A] = (unsigned char)headersize;
793793 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);
796796 bmpdata[0x1A] = 1;
797797 bmpdata[0x1C] = 24;
798798 bmpdata[0x1E] = 0;
--- trunk/d3dgraphics-opengl.cpp (revision 334)
+++ trunk/d3dgraphics-opengl.cpp (revision 335)
@@ -3210,15 +3210,18 @@
32103210 }
32113211
32123212 //ヘッダーを生成
3213- for(int i=0; i<54; i++){
3214- header[i] = 0x00;
3215- }
3213+ for(int i=0; i<54; i++){ header[i] = 0x00; }
32163214 header[0x00] = 'B';
32173215 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;
32193219 Set4ByteLittleEndian(&(header[0x12]), GameConfig.GetScreenWidth());
32203220 Set4ByteLittleEndian(&(header[0x16]), GameConfig.GetScreenHeight());
3221+ header[0x1A] = 1;
32213222 header[0x1C] = 24;
3223+ header[0x1E] = 0;
3224+ Set4ByteLittleEndian(&(header[0x22]), GameConfig.GetScreenWidth()*GameConfig.GetScreenHeight()*3);
32223225
32233226 //ヘッダーを書き込む
32243227 fwrite(header, 1, 54, fp);
@@ -3231,6 +3234,15 @@
32313234
32323235 fwrite(&pixel, 1, 3, fp);
32333236 }
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+ }
32343246 }
32353247
32363248 //ファイルハンドルを解放