Merge lp:~der-treba/stratagus/stratagus into lp:stratagus
Status: | Needs review |
---|---|
Proposed branch: | lp:~der-treba/stratagus/stratagus |
Merge into: | lp:stratagus |
Diff against target: |
360 lines (+188/-85) 5 files modified
src/game/game.cpp (+1/-0) src/include/video.h (+2/-0) src/stratagus/stratagus.cpp (+3/-0) src/video/sdl.cpp (+108/-85) src/video/video.cpp (+74/-0) |
To merge this branch: | bzr merge lp:~der-treba/stratagus/stratagus |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Pali | Needs Fixing | ||
treba | Pending | ||
Review via email: mp+159972@code.launchpad.net |
Description of the change
Hello,
i made some small changes to the engine that allow us to get the native resolution of the screen within lua and let's us determine all available resolutions.
examples:
local defaultPreferences = {
...
VideoWidth = GetCurrentResol
VideoHeight = GetCurrentResol
...
}
for i=0,GetVideoRes
print(
end
i hope the code quality is ok. i only tested it on linux, but to me, it seems to be quite solid.
Unmerged revisions
- 8698. By treba
-
- removed declarations of lua bindings from video.h
- replaced resolution calls with the following two:
GetCurrentResolution( ) -- array with width and height of current resolution. if called at startup, the optimal resolution is given
GetAvailableResolutions( ) -- two dimensional array with available resolutions. in window mode gives nil - 8697. By treba
-
added lua queries to determine the default resolution of a screen aswell as queries to for supported resolutions.
GetVideoResolut
ionsNr( ) - get number of available resolutions
GetResolutionsWidth(i) - get width of resolution i
GetResolutionsHeight(i) - see above
GetCurrentResolutionsWidth( ) - get current resolution width. if queried on startup, it's the default/optimal resolution
GetCurrentResolutionsHeight( ) - see above
ok, i removed the stuff from the header and replaced the calls with two simple ones:
GetCurrentResol ution() -- array with width and height of current resolution. if called at startup, the optimal resolution is given
GetAvailableRes olutions( ) -- two dimensional array with available resolutions. in window mode gives nil
i guess it's ready now