Skip to content

Commit

Permalink
replace window* vars with view* vars
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Sep 22, 2021
1 parent 084ded1 commit ee90b04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions defos/src/defos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,19 +705,19 @@ dmExtension::Result InitializeDefos(dmExtension::Params *params)
defos_init();

//read initial size and position from game.project
float window_width = dmConfigFile::GetInt(params->m_ConfigFile, "defos.window_width", -1.0);
float window_height = dmConfigFile::GetInt(params->m_ConfigFile, "defos.window_height", -1.0);
float window_x = dmConfigFile::GetInt(params->m_ConfigFile, "defos.window_x", -1.0);
float window_y = dmConfigFile::GetInt(params->m_ConfigFile, "defos.window_y", -1.0);
if (window_width != -1.0 && window_height != -1.0)
float view_width = dmConfigFile::GetInt(params->m_ConfigFile, "defos.view_width", -1.0);
float view_height = dmConfigFile::GetInt(params->m_ConfigFile, "defos.view_height", -1.0);
float view_x = dmConfigFile::GetInt(params->m_ConfigFile, "defos.view_x", -1.0);
float view_y = dmConfigFile::GetInt(params->m_ConfigFile, "defos.view_y", -1.0);
if (view_width != -1.0 && view_height != -1.0)
{
if (window_x != -1.0 && window_y != -1.0)
if (view_x != -1.0 && view_y != -1.0)
{
defos_set_view_size(window_x, window_y, window_width, window_height);
defos_set_view_size(view_x, view_y, view_width, view_height);
}
else
{
defos_set_view_size(nanf(""), nanf(""), window_width, window_height);
defos_set_view_size(nanf(""), nanf(""), view_width, view_height);
}
}

Expand Down
8 changes: 4 additions & 4 deletions game.project
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ bundle_identifier = com.subsoap.defos
bundle_identifier = com.subsoap.defos

[defos]
window_width = 800
window_height = 600
window_x = 60
window_y = 40
view_width = 800
view_height = 600
view_x = 60
view_y = 40

0 comments on commit ee90b04

Please sign in to comment.