Log Verbosity override

Game Programming/Unreal Engine 2020. 5. 25. 23:14

Config/DefaultEngine.ini

[Core.Log]
LogCategoryName=NewVerbosityLevel

ex

[Core.Log]
LogFoobar=Log

로그 카테고리 선언 참고.

foobarLog.h

DECLARE_LOG_CATEGORY_EXTERN(LogFoobar, Display, All);

foobarLog.cpp

DEFINE_LOG_CATEGORY(LogFoobar);

설정

트랙백

댓글

모든 메쉬 다시 저장

Game Programming/Unreal Engine 2020. 1. 28. 15:58

"Engine/Binaries/Win64/UE4Editor-Cmd.exe" "project_path" -run=ResavePackages -unattended -nopause -buildmachine -autocheckout -autocheckin -projectonly -resaveclass="StaticMesh,SkeletalMesh"

설정

트랙백

댓글

Auto Attach 디버깅 툴(Visual Studio)

Game Programming/C++ 2019. 4. 16. 15:13

설정

트랙백

댓글

NDK BUILD

Game Programming/Android 2018. 7. 2. 12:57

https://developer.android.com/ndk/guides/ndk-build?hl=ko


설정

트랙백

댓글

생성자/파괴자 내부에서 virtual 함수 사용이 안되는(virtual 대신 일반 함수처럼 동작됨) 이유

Game Programming/C++ 2018. 3. 8. 07:18

https://stackoverflow.com/questions/962132/calling-virtual-functions-inside-constructors

https://isocpp.org/wiki/faq/strange-inheritance#calling-virtuals-from-ctors

1 . 생성자에서 부를 때 명확한 예

  1. #include<string>
  2. #include<iostream>
  3. using namespace std;
  4. class B {
  5. public:
  6. B(const string& ss) { cout << "B constructor\n"; f(ss); }
  7. virtual void f(const string&) { cout << "B::f\n";}
  8. };
  9. class D : public B {
  10. public:
  11. D(const string & ss) :B(ss) { cout << "D constructor\n";}
  12. void f(const string& ss) { cout << "D::f\n"; s = ss; }
  13. private:
  14. string s;
  15. };
  16. int main()
  17. {
  18. D d("Hello");
  19. }

결과

  1. B constructor
  2. B::f
  3. D constructor


만일 B::f 대신 D::f 를 허용한다면 D constructor 호출 이전이므로

s = ss; 에서 초기화되지 않은 string s 를 사용해야하므로 crash 가 발생할 수 있다.

 C++ is protecting you from that danger. 의 차원에서 허용되지 않는다고 볼 수 있다.


2. 파괴자에서는 생성자 호출 순서의 역순으로 수행되므로

위의 클래스 예를 들어보면 D 의 파괴자 호출 후에 B 파괴자가 호출된다.

B 파괴자 내부에서 f(ss); 를 호출하여 D::f 를 호출 한다는 것도 성립할 수 없게 된다.(만일 D::f 가 호출된다면 이미 파괴된 string s 를 참조하려고 한다.)


설정

트랙백

댓글

여러 폰트를 사용중 같은 위치에 출력하고 싶을때 !!!

Game Programming/C++ 2011. 12. 9. 22:08

47.4 How can I draw a single line of text with different fonts using DrawString?

   

The key is that you have to calculate the ascent height of the font. The font ascent as reported by FontFamily.GetCellAscent is in what is called 'Design Units'. The Cell Spacing design unit value of fonts is proportional to the actual height of the font on the device. We use this relationship to calculate cell ascent in device units.

The rendering code has to just ensure that the x, y position passed to DrawString takes care of the ascent.

     private void HandlePaint(object sender, PaintEventArgs args) 
     { 
          // clear the background 
          Graphics g = args.Graphics; 
          g.Clear(Color.AliceBlue); 
           
          // create a pen 
          Pen pen = new Pen(Color.Red, 1f); 
           
          // the string to be drawn 
          string s = "Side by side"; 
           
          // the first font 
          Font f1 = new Font("Arial", 10f); 
          float strWidth1 = g.MeasureString(s, f1).Width; 
          float fontHeight1 = f1.GetHeight(g);      
          float fontAscentHeight1 = (fontHeight1/f1.FontFamily.GetLineSpacing(f1.Style))*f1.FontFamily.GetCellAscent(f1.Style); 
                
          // the second font 
          Font f2 = new Font("Times New Roman", 48); 
               float fontHeight2 = f2.GetHeight(g);      
               float fontAscentHeight2 = (fontHeight2/f2.FontFamily.GetLineSpacing(f2.Style))*f2.FontFamily.GetCellAscent(f2.Style); 

          // draw the base line      
          Point ptStart = new Point(0, this.ClientSize.Height/2); 
          Point ptEnd = new Point(this.ClientSize.Width, this.ClientSize.Height/2); 
          g.DrawLine(Pens.Black, ptStart, ptEnd); 
      
          // draw string with first font 
          g.DrawString(s, f1, Brushes.Red, new PointF(0, ptStart.Y - fontAscentHeight1)); 
          // draw string with second font 
          g.DrawString(s, f2, Brushes.Red, new PointF(strWidth1, ptStart.Y - fontAscentHeight2)); 
     }

참고 : http://msdn.microsoft.com/en-us/library/xwf9s90b.aspx
출처 : http://www.syncfusion.com/FAQ/windowsforms/faq_c39c.aspx 

설정

트랙백

댓글

Visual Studio 유용한 정규식 패턴

Game Programming/C++ 2011. 6. 14. 18:54

  • ".*[가-힣]+.*" : 한글이 하나이상 포함되어 있는 문자열 선택
  • visual studio 에서 찾아 바꾸기 정규식 사용시 () 태깅한 텍스트는 바꾸기 에서 $n 으로 대응됨. (n 은 1 에서 9가 들어갈수 있으며 0을 입력하면 전체를 의미함)

     ex ) UE_LOG(Log, 로 시작하고
    찾을 내용:
    UE_LOG\(Log, ([\s\w\d,]+)TEXT\(\"([\s\w\d-_\(\)\[\]%*.,:=!]+)\"\)
    바꿀 내용:
    LOG($1"$2"



  • msdn :  https://msdn.microsoft.com/ko-kr/library/2k3te2cs.aspx 참고


설정

트랙백

댓글

D3D X파일 멀티애니메이션 모델 만드는 법

Game Programming/Direct3D 2011. 1. 11. 15:58
같은 모델을 사용하고 애니메이션만 서로 다를 경우 애니메이션을 합쳐서 하나의 .x 파일로 만들수 있다.
1. 판다 익스포트를 사용하여 애니메이션 프레임 구간을 나누어 저장한다.
2. Text 파일 형식으로 .x 를 익스포트 한 후, 각 .x 에서 'AnimationSet 이름' 을 복사하여 합치려는 .x 파일 끝에 붙인다.

출처 : GPG 포럼

설정

트랙백

댓글