Tweaked lighting in MainGame scene a bit cuz it looked janky at one portion, Hide and clip mouse cursor for builds without editor (only when window is active) #348

Merged
srishamharan merged 1 commits from PreAlphaFixes into main 2023-02-04 11:26:56 +08:00
5 changed files with 38 additions and 174 deletions

View File

@ -1,167 +0,0 @@
[Window][MainStatusBar]
Pos=0,989
Size=2560,20
Collapsed=0
[Window][SHEditorMenuBar]
Pos=0,48
Size=2560,941
Collapsed=0
[Window][Hierarchy Panel]
Pos=0,187
Size=300,802
Collapsed=0
DockId=0x00000004,0
[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0
[Window][Inspector]
Pos=2074,48
Size=486,941
Collapsed=0
DockId=0x00000006,0
[Window][Profiler]
Pos=0,48
Size=300,137
Collapsed=0
DockId=0x00000003,0
[Window][Viewport]
Pos=227,48
Size=1457,1012
Collapsed=0
DockId=0x0000000B,0
[Window][ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌð‡Žoû]
Pos=60,60
Size=32,64
Collapsed=0
[Window][ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ]
Pos=60,60
Size=999,581
Collapsed=0
[Window][ð‡]
Pos=60,60
Size=32,64
Collapsed=0
[Window][ÌÌÌÌ]
Pos=60,60
Size=553,422
Collapsed=0
[Window][]
Pos=60,60
Size=770,394
Collapsed=0
[Window][ Viewport]
Pos=227,48
Size=1457,1012
Collapsed=0
DockId=0x0000000B,0
[Window][ Viewport]
Pos=227,48
Size=1457,1012
Collapsed=0
DockId=0x0000000B,0
[Window][î<> Viewport]
Pos=302,48
Size=1770,705
Collapsed=0
DockId=0x0000000B,0
[Window][V]
Pos=310,722
Size=1501,338
Collapsed=0
DockId=0x00000008,0
[Window][p£€Ê]
Pos=310,750
Size=1501,310
Collapsed=0
DockId=0x0000000A,0
[Window][ Asset Browser]
Pos=302,755
Size=1770,234
Collapsed=0
DockId=0x0000000C,0
[Window][Material Inspector]
Pos=2074,48
Size=486,941
Collapsed=0
DockId=0x00000006,1
[Window][Save scene as...]
Pos=1197,693
Size=165,120
Collapsed=0
[Window][Create New Asset]
Pos=896,472
Size=464,144
Collapsed=0
[Window][Collider Tag Panel]
Pos=302,48
Size=1770,705
Collapsed=0
DockId=0x0000000B,1
[Window][Input Bindings Panel]
Pos=2074,48
Size=486,941
Collapsed=0
DockId=0x00000006,2
[Window][Save Scene As]
Pos=877,444
Size=165,120
Collapsed=0
[Table][0x9D40AE32,17]
Column 0 Weight=1.0696
Column 1 Weight=0.9194
Column 2 Weight=0.9945
Column 3 Weight=1.0320
Column 4 Weight=0.9570
Column 5 Weight=0.9945
Column 6 Weight=0.9945
Column 7 Weight=0.9945
Column 8 Weight=0.9945
Column 9 Weight=1.0320
Column 10 Weight=0.9570
Column 11 Weight=1.0133
Column 12 Weight=0.9945
Column 13 Weight=0.8444
Column 14 Weight=0.9945
Column 15 Weight=0.8632
Column 16 Weight=1.3510
[Docking][Data]
DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=2560,941 Split=X
DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=1432,1036 Split=X
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1130,1036 Split=Y Selected=0xB41284E7
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7
DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,705 CentralNode=1 Selected=0xB41284E7
DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,234 Selected=0xB128252A
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532
DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=486,1036 Selected=0xE7039252

View File

@ -8476,7 +8476,7 @@
Light Component: Light Component:
Position: {x: 2, y: 1.5, z: -5.5999999} Position: {x: 2, y: 1.5, z: -5.5999999}
Type: Directional Type: Directional
Direction: {x: 1, y: 0, z: 0} Direction: {x: -0.245000005, y: 0, z: 0}
Color: {x: 0, y: 0, z: 0, w: 1} Color: {x: 0, y: 0, z: 0, w: 1}
Layer: 4294967295 Layer: 4294967295
Strength: 1 Strength: 1

View File

@ -171,6 +171,7 @@ namespace Sandbox
SHSceneManager::InitSceneManager<SBMainScene>(editorConfig.workingSceneID); SHSceneManager::InitSceneManager<SBMainScene>(editorConfig.workingSceneID);
#else #else
SHSceneManager::InitSceneManager<SBMainScene>(appConfig.startingSceneID); SHSceneManager::InitSceneManager<SBMainScene>(appConfig.startingSceneID);
window.SetMouseVisible(false);
#endif #endif
SHFrameRateController::UpdateFRC(); SHFrameRateController::UpdateFRC();
@ -199,7 +200,8 @@ namespace Sandbox
#ifdef SHEDITOR #ifdef SHEDITOR
if(editor->editorState == SHEditor::State::PLAY) if(editor->editorState == SHEditor::State::PLAY)
#else
window.ClipMouseCursor();
#endif #endif
SHSceneManager::SceneUpdate(0.016f); SHSceneManager::SceneUpdate(0.016f);
#ifdef SHEDITOR #ifdef SHEDITOR

View File

@ -185,12 +185,40 @@ namespace SHADE
void SHWindow::SetMouseVisible(bool show) void SHWindow::SetMouseVisible(bool show)
{ {
ShowCursor(show ? TRUE : FALSE); if (GetActiveWindow() == wndHWND)
ShowCursor(show);
} }
void SHWindow::SetMousePosition(unsigned x, unsigned y) void SHWindow::SetMousePosition(int x, int y)
{ {
SetCursorPos(x, y); if(GetActiveWindow() == wndHWND)
{
//if(x == -1)
// x = GetSystemMetrics(SM_CXSCREEN) * 0.5;
//if (y == -1)
// y = GetSystemMetrics(SM_CYSCREEN) * 0.5;
//SetCursorPos(x, y);
}
}
void SHWindow::ClipMouseCursor(int left, int top, int right, int bottom)
{
if (GetActiveWindow() == wndHWND)
{
RECT rect{};
if (left == 0 || right == 0)
{
GetClientRect(wndHWND, &rect);
}
else
{
rect.left = left;
rect.right = right;
rect.top = top;
rect.bottom = bottom;
}
ClipCursor(&rect);
}
} }
//unsigned SHWindow::GetBGColor() //unsigned SHWindow::GetBGColor()

View File

@ -106,7 +106,9 @@ namespace SHADE
void SetMouseVisible(bool show); void SetMouseVisible(bool show);
void SetMousePosition(unsigned x, unsigned y); void SetMousePosition(int x = -1, int y = -1);
void ClipMouseCursor(int left = 0, int top = 0, int right = 0, int bottom = 0);
//unsigned GetBGColor(); //unsigned GetBGColor();
@ -144,7 +146,6 @@ namespace SHADE
void SetHWND(HWND hwnd); void SetHWND(HWND hwnd);
HWND wndHWND = nullptr; HWND wndHWND = nullptr;
HINSTANCE hInstance = nullptr; HINSTANCE hInstance = nullptr;