mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-19 21:09:29 +00:00
Merge branch 'experimental' into controllerfixup
# Conflicts: # Aquaria/Avatar.cpp # Aquaria/Continuity.cpp # Aquaria/DSQ.cpp # Aquaria/DSQ.h # Aquaria/Game.cpp # Aquaria/Game.h # Aquaria/Main.cpp # Aquaria/UserSettings.cpp # BBGE/Base.cpp # BBGE/Base.h # BBGE/Core.cpp # BBGE/Core.h # BBGE/DebugFont.cpp # BBGE/Shader.cpp # BBGE/SoundManager.h
This commit is contained in:
commit
0dc30e668d
67 changed files with 788 additions and 511 deletions
|
@ -350,7 +350,7 @@ Core::Core(const std::string &filesystem, const std::string& extraDataDir, int n
|
|||
#if defined(BBGE_BUILD_UNIX)
|
||||
const char *envr = getenv("HOME");
|
||||
if (envr == NULL)
|
||||
envr = "."; // oh well.
|
||||
envr = "."; // oh well.
|
||||
const std::string home(envr);
|
||||
|
||||
createDir(home); // just in case.
|
||||
|
@ -769,7 +769,6 @@ bool Core::initGraphicsLibrary(int width, int height, bool fullscreen, bool vsyn
|
|||
#endif
|
||||
|
||||
initIcon(gScreen);
|
||||
// Create window
|
||||
|
||||
std::ostringstream os;
|
||||
os << "setting vsync: " << vsync;
|
||||
|
@ -979,22 +978,22 @@ void Core::applyState(const std::string &state)
|
|||
#ifdef BBGE_BUILD_WINDOWS
|
||||
void centerWindow(HWND hwnd)
|
||||
{
|
||||
int x, y;
|
||||
HWND hwndDeskTop;
|
||||
RECT rcWnd, rcDeskTop;
|
||||
// Get a handle to the desktop window
|
||||
hwndDeskTop = ::GetDesktopWindow();
|
||||
// Get dimension of desktop in a rect
|
||||
::GetWindowRect(hwndDeskTop, &rcDeskTop);
|
||||
// Get dimension of main window in a rect
|
||||
::GetWindowRect(hwnd, &rcWnd);
|
||||
// Find center of desktop
|
||||
int x, y;
|
||||
HWND hwndDeskTop;
|
||||
RECT rcWnd, rcDeskTop;
|
||||
// Get a handle to the desktop window
|
||||
hwndDeskTop = ::GetDesktopWindow();
|
||||
// Get dimension of desktop in a rect
|
||||
::GetWindowRect(hwndDeskTop, &rcDeskTop);
|
||||
// Get dimension of main window in a rect
|
||||
::GetWindowRect(hwnd, &rcWnd);
|
||||
// Find center of desktop
|
||||
x = (rcDeskTop.right - rcDeskTop.left)/2;
|
||||
y = (rcDeskTop.bottom - rcDeskTop.top)/2;
|
||||
x -= (rcWnd.right - rcWnd.left)/2;
|
||||
x -= (rcWnd.right - rcWnd.left)/2;
|
||||
y -= (rcWnd.bottom - rcWnd.top)/2;
|
||||
// Set top and left to center main window on desktop
|
||||
::SetWindowPos(hwnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
|
||||
// Set top and left to center main window on desktop
|
||||
::SetWindowPos(hwnd, HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -1002,7 +1001,7 @@ void centerWindow(HWND hwnd)
|
|||
|
||||
// No longer part of C/C++ standard
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
void Core::setPixelScale(int pixelScaleX, int pixelScaleY)
|
||||
|
@ -1158,7 +1157,7 @@ std::string getScreenshotFilename(bool png)
|
|||
std::ostringstream os;
|
||||
os << prefix << screenshotNum << ext;
|
||||
screenshotNum ++;
|
||||
std::string str(os.str());
|
||||
std::string str(os.str());
|
||||
if (!core->exists(str)) // keep going until we hit an unused filename.
|
||||
return str;
|
||||
}
|
||||
|
@ -1195,7 +1194,6 @@ void Core::run(float runTime)
|
|||
float dt;
|
||||
float counter = 0;
|
||||
int frames = 0;
|
||||
float real_dt = 0;
|
||||
|
||||
#if !defined(_DEBUG)
|
||||
bool wasInactive = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue