#!/usr/bin/php # # This program is free software: you can redistribute it and/or modify it under the terms of # the GNU General Public License version 3 as published by the Free Software Foundation. # See http://www.gnu.org/licenses/gpl-3.0.html for more details. # Change history: # 2010-08-03, change the LIBGL_DRIVERS_PATH to /usr/lib32/dri/ # 2009-09-06, change the Russian encoding (for the LANG environment variable) from KOI8-R to CP1251 # 2009-03-20, make the "Quiet mode" an option, off by default # 2009-02-08, initial public release for($i=0; $i Options: -sysdir Path to the "system" folder of your LA2 installation -w Set window width (horizontal resolution) -h Set window height (vertical resolution) -fs Enable full-screen mode -win Enable window (not full-screen) mode -ld Enable low detail mode -fd Enable full-detail mode -q Quiet mode (turn off extraneous Wine warnings and FIXMEs) -dri32 Point LIBGL_DRIVERS_PATH to 32-bit DRI libs --help Show this message EOS; die(); break; } } $option_ini = @file_get_contents('Option.ini'); if($option_ini===false) die ("Unable to load Option.ini"); rename('Option.ini', 'Option.ini.bak'); if(isset($RES_X)) { echo "Setting horisontal resolution to $RES_X\n"; $option_ini = preg_replace('/GamePlayViewportX=.+/i', 'GamePlayViewportX='.$RES_X, $option_ini); } if(isset($RES_Y)) { echo "Setting vertical resolution to $RES_Y\n"; $option_ini = preg_replace('/GamePlayViewportY=.+/i', 'GamePlayViewportY='.$RES_Y, $option_ini); } if(isset($FULLSCREEN)){ if($FULLSCREEN) $FULLSCREEN_s = 'True'; else $FULLSCREEN_s = 'False'; echo "Setting full screen mode to $FULLSCREEN_s\n"; $option_ini = preg_replace('/StartupFullScreen=.+/i', 'StartupFullScreen='.$FULLSCREEN_s, $option_ini); } if(isset($LOWDETAIL)){ if($LOWDETAIL) $LOWDETAIL_s = 'True'; else $LOWDETAIL_s = 'False'; echo "Setting low detail mode to $LOWDETAIL_s\n"; $option_ini = preg_replace('/IsKeepMinFrameRate=.+/i', 'IsKeepMinFrameRate='.$LOWDETAIL_s, $option_ini); } $result = file_put_contents('Option.ini', $option_ini); if($result===false) die ("Unable to save Option.ini"); # Для нормального русского ввода в игре putenv("LANG=ru_RU.CP1251"); # Для отладки # die(`cat Option.ini`); # Поехали! :) system('wine L2.exe'); # После выхода из игры, восстанавливаем гамму system('xgamma -gamma 1.0'); ?>