From: Charles McGarvey Date: Wed, 13 Jul 2011 07:11:10 +0000 (-0600) Subject: update video methods X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=ecfc966a7b2d8e37c7f5e29227d5ba4d00e54ded;p=chaz%2Fyoink update video methods --- diff --git a/data/yoinkrc b/data/yoinkrc index 1d58bef..6698018 100644 --- a/data/yoinkrc +++ b/data/yoinkrc @@ -4,78 +4,84 @@ print "loading default settings..." --- Set the level of detail to use when drawing scenes. This can be 1, 2 or --- 3, where 1 shows the least amount of detail and 3 draws the scene with --- the most detail. Lower levels of detail may improve performance on --- slower machines. +-- Set the level of detail to use when drawing scenes. This can be 1, 2 or 3, +-- where 1 shows the least amount of detail and 3 draws the scene with the +-- most detail. Lower levels of detail may improve performance on slower +-- machines. -detail = 3 +detail = 3 --- Set the number of times each second the physics state will be updated. --- The quality of the physics simulation will increase as you increase this --- value, but the processor will be taxed more. Errors could be introduced --- in the game with extremely low values. +-- Set the number of times each second the physics state will be updated. The +-- quality of the physics simulation will increase as you increase this value, +-- but the processor will be taxed more. Errors could be introduced in the +-- game with extremely low values. -timestep = 100 +timestep = 100 -- Set the target number of frames that should be drawn per second. The -- smoothness of the animation increases as you increase this value. You --- probably want to set this somewhere in the 25-200 range, depending on --- how much work you want your computer to do. For example, if you're on --- battery power, you might prefer 25 which is still reasonably smooth and --- will decrease battery drain significantly. You can also set this to an --- arbitrarily high number to effectively draw as many frames as possible, --- but your actual framerate might be limited by the refresh rate of your --- display; use the swapcontrol setting to enable or disable this behavior. --- You can determine your actual framerate with the showfps option. +-- probably want to set this somewhere in the 25-200 range, depending on how +-- much work you want your computer to do. For example, if you're on battery +-- power, you might prefer 25 which is still reasonably smooth and will +-- decrease battery drain significantly. You can also set this to an +-- arbitrarily high number to effectively draw as many frames as possible, but +-- your actual framerate might be limited by the refresh rate of your display; +-- use the swapcontrol setting to enable or disable this behavior. You can +-- determine your actual framerate with the showfps option. -framerate = timestep +framerate = 60 -- Set this to show the current frames per second in the window caption. -showfps = false +showfps = false --- Set this to run the game in full-screen mode. The default behavior is --- to run the game in a window. +-- Set this to run the game in full-screen mode. The default behavior is to +-- run the game in a window. -fullscreen = false +fullscreen = false -- If the game is running in a window, set this to also make the window -- resizable. This has no effective if the fullscreen option is set. -resizable = true +resizable = true --- Set the display resolution or size of the viewing window. If left at --- the default value (a function), the video mode will only be set if we're --- not in fullscreen. That way, a native resolution will be used. +-- Set the display resolution or size of the viewing window. If left at the +-- default value (a function), the video mode will only be set if we're not in +-- fullscreen. That way, a native resolution will be used. -videomode = function() +videomode = function() if not fullscreen then return {800, 600} end end --- Set this to use double-buffering to improve animation quality. You --- really don't want to turn this off. +-- Set this to use double-buffering to improve animation quality. You really +-- don't want to turn this off. doublebuffer = true -- Set this to sync with the refresh rate of your display. Your framerate --- will be limited to the refresh rate, but you may experience less --- tearing caused by the display vertical refresh. On the other hand, you --- might experience worse tearing, depending on your setup. Try it both --- ways. +-- will be limited to the refresh rate, but you may experience less tearing +-- caused by the display vertical refresh. On the other hand, you might +-- experience worse tearing, depending on your setup. Try it both ways. -swapcontrol = true +swapcontrol = false --- Set the level of log detail that will be output to the console. --- Possible values are: +-- Set this to the number of FSAA samples to perform. This will smooth out +-- jagged lines but may reduce framerates on slow hardware. Possible values +-- depend on your video card and drivers, but typical values include 1, 2, 4, +-- and higher powers of two. Set to 0 to disable FSAA. + +multisamples = 0 + +-- Set the level of log detail that will be output to the console. Possible +-- values are: -- 0 nothing -- 1 errors -- 2 warnings -- 3 info -- 4 debug messages -loglevel = 2 +loglevel = 2 --- vi:ft=lua ts=4 sw=4 tw=75 +-- vi:ft=lua diff --git a/scripts/textureattr.pl b/scripts/textureattr.pl index a12c2fd..391750d 100755 --- a/scripts/textureattr.pl +++ b/scripts/textureattr.pl @@ -54,7 +54,7 @@ seek $tmpfile, 0, 0; $text = <$tmpfile>; # Use pngcrush to rewrite the image file with the new text. -system("pngcrush", "-fix", "-rem", "text", "-text", "b", +system("pngcrush", "-fix", "-oldtimestamp", "-rem", "text", "-text", "b", $key, $text, $infile, $tmpfile); if (0 == $? >> 8) { not $outfile and $outfile = $infile; diff --git a/src/Hud.cc b/src/Hud.cc index 20d6b4e..5687ac8 100644 --- a/src/Hud.cc +++ b/src/Hud.cc @@ -103,9 +103,9 @@ Hud::Hud(GameState& state) : mBar2(moof::sprite("StatusBars"), 2), mFont("Font") { - moof::video* video = moof::video::current(); - ASSERT(video && "a current video context should be set"); - resize(video->width(), video->height()); + ASSERT(moof::video::ready() && "a current video context should be set"); + moof::video& video = moof::video::current(); + resize(video.width(), video.height()); } void Hud::resize(int width, int height)