mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Add clouds! (optional feature)
This commit is contained in:
@@ -208,6 +208,13 @@ static EM_BOOL main_loop(double time, void *user_data)
|
||||
}
|
||||
|
||||
extern bool g_bIsMenuBackgroundAvailable; // client/gui/Screen.cpp
|
||||
extern bool g_bAreCloudsAvailable; // client/renderer/LevelRenderer.cpp
|
||||
|
||||
void CheckOptionalTextureAvailability()
|
||||
{
|
||||
g_bIsMenuBackgroundAvailable = XPL_ACCESS("assets/gui/background/panorama_0.png", 0) == 0;
|
||||
g_bAreCloudsAvailable = XPL_ACCESS("assets/environment/clouds.png", 0) == 0;
|
||||
}
|
||||
|
||||
// Main
|
||||
int main(int argc, char *argv[])
|
||||
@@ -237,7 +244,7 @@ int main(int argc, char *argv[])
|
||||
Minecraft::height = std::stoi(argv[2]);
|
||||
#endif
|
||||
|
||||
g_bIsMenuBackgroundAvailable = XPL_ACCESS("assets/gui/background/panorama_0.png", 0) == 0;
|
||||
CheckOptionalTextureAvailability();
|
||||
|
||||
// Create Window
|
||||
window = SDL_CreateWindow("ReMinecraftPE", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, Minecraft::width, Minecraft::height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
|
||||
|
||||
@@ -70,8 +70,6 @@ void UpdateMouse()
|
||||
Mouse::setY(g_MousePosY);
|
||||
}
|
||||
|
||||
extern bool g_bIsMenuBackgroundAvailable;
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (iMsg)
|
||||
@@ -201,6 +199,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern bool g_bIsMenuBackgroundAvailable; // client/gui/Screen.cpp
|
||||
extern bool g_bAreCloudsAvailable; // client/renderer/LevelRenderer.cpp
|
||||
|
||||
void CheckOptionalTextureAvailability()
|
||||
{
|
||||
// Optional features that you really should be able to get away with not including.
|
||||
g_bIsMenuBackgroundAvailable = XPL_ACCESS("assets/gui/background/panorama_0.png", 0) == 0;
|
||||
g_bAreCloudsAvailable = XPL_ACCESS("assets/environment/clouds.png", 0) == 0;
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
SetInstance(hInstance);
|
||||
@@ -220,7 +228,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = g_WindowClassName;
|
||||
|
||||
g_bIsMenuBackgroundAvailable = XPL_ACCESS("assets/gui/background/panorama_0.png", 0) == 0;
|
||||
CheckOptionalTextureAvailability();
|
||||
|
||||
RECT wr = { 0,0, g_AppPlatform.getScreenWidth(), g_AppPlatform.getScreenHeight() };
|
||||
AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, false);
|
||||
|
||||
Reference in New Issue
Block a user