aboutsummaryrefslogtreecommitdiff
path: root/src/camera.h
Commit message (Expand)AuthorAge
* Add zoom, tweakable with zoom_fov, default key: Z (like optifine)Esteban I. Ruiz Moreno2016-08-10
* Camera: remove auto tune FPS, single view range settingRealBadAngel2016-02-21
* Minimap: show player markersRealBadAngel2016-02-19
* Move object nametags to cameraRealBadAngel2016-02-18
* Add wielded (and CAOs) shaderRealBadAngel2015-07-21
* Change error_message from wstring to stringShadowNinja2015-03-27
* Replace std::list to std::vector into tile.cpp (m_texture_trash) and move til...Loic Blot2015-03-05
* Fix regression (increase/decrease viewing range with +/- keys)Craig Robbins2014-12-07
* Performance of main client loop up to 2x faster In places, up to 3 times fasterCraig Robbins2014-12-07
* Implement WieldMeshSceneNode which improves wield mesh renderingKahrl2014-11-08
* Add support for interlaced polarized 3d screenssapier2014-05-18
* Add support for dpi based HUD scalingsapier2014-04-27
* Fix all warnings reported by clangSfan52014-04-15
* Add player:set_eye_offset() by @MirceaKitsune and clean upBlockMen2014-04-12
* Add third person viewBlockMen2014-04-12
* Fix rendering glitches when far from the center of the mapNovatux2014-03-04
* Fix and improve view range tunerPerttu Ahola2013-08-03
* Add a little animation when changing the wielded itemPilzAdam2013-05-20
* Swing the camera down when the player lands on the ground, based on the veloc...MirceaKitsune2013-04-11
* fix mesh leak in camera classsapier2013-04-07
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Optimize headersPerttu Ahola2012-06-17
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* c55sound continuedPerttu Ahola2012-03-24
* Fix and tune things, add tool "recharge" animation, add dummyballPerttu Ahola2012-03-10
* Page up and down change the minimum viewing rangeKahrl2012-02-01
* The huge item definition and item namespace unification patch (itemdef), see ...Kahrl2012-01-12
* inventorycube: use all three specified textures; also moved mesh creation / m...Kahrl2011-12-03
* Fix structs being declared as classesGiuseppe Bilotta2011-12-01
* GameDef compilesPerttu Ahola2011-11-29
* Create framework for getting rid of global definitions of node/tool/item/what...Perttu Ahola2011-11-29
* Header file tweaking; mainly for speedPerttu Ahola2011-10-12
* Simplistic wielded tool lighting, added setMeshVerticesColor to utility.h and...Kahrl2011-09-21
* Create a separate scene manager for the wielded tool. This fixes the glitchyn...Kahrl2011-09-21
* Digging animationKahrl2011-09-20
* Wielded tool updates, leaves and glass work nowKahrl2011-09-19
* Convert any inventory item into a mesh, bring back InventoryItem::getImageRay...Kahrl2011-09-19
* Added sprite extruderKahrl2011-09-19
* This looks more like MC view bobbing, but still not even closeKahrl2011-09-18
* Made wielded tool move slightly (and smoothly) during view bobbing. Making th...Kahrl2011-09-15
* View bobbing is slower in the water.Kahrl2011-09-15
* Implemented view bobbing (testing simple lemniscate shape)Kahrl2011-09-08
* Collected and moved existing camera infrastructure from game.cpp to camera.cp...Kahrl2011-09-08
then error("Failed opening file '"..filename.."' for write:\n"..err) end callback(file) return true end local function open_file_and_load_callback(filename, callback) local file, err = io.open(filename, "r") if not file then error("Failed opening file '"..filename.."' for read:\n"..err) end return callback(file) end -- == public functions == -- Load a saved state (according to comment above) -- if 'callback' is nil: reads serialized table. -- returns the read table, or nil,err on error -- if 'callback' is a function (signature func(file_handle) ): -- Counterpart to save_atomic with function argument. Opens the file and calls callback on it. -- If the callback function throws an error, and strict loading is enabled, that error is propagated. -- The callback's first return value is returned by load_atomic function serialize_lib.load_atomic(filename, callback) local cbfunc = callback or ser.read_from_fd -- try <filename> local file, ret = io.open(filename, "r") if file then -- read the file using the callback local success success, ret = pcall(cbfunc, file) if success then return ret end end if minetest.settings:get_bool("serialize_lib_strict_loading") then serialize_lib.save_lock = true error("Loading data from file '"..filename.."' failed:\n" ..ret.."\nDisable Strict Loading to ignore.") end serialize_lib.log_warn("Loading data from file '"..filename.."' failed, trying .new fallback:") serialize_lib.log_warn(ret) -- try <filename>.new file, ret = io.open(filename..".new", "r") if file then -- read the file using the callback local success success, ret = pcall(cbfunc, file) if success then return ret end end serialize_lib.log_error("Unable to load data from '"..filename..".new':") serialize_lib.log_error(ret) serialize_lib.log_error("Note: This message is normal when the mod is loaded the first time on this world.") return nil, ret end -- Save a file atomically (as described above) -- 'data' is the data to be saved (when a callback is used, this can be nil) -- if 'callback' is nil: -- data must be a table, and is serialized into the file -- if 'callback' is a function (signature func(data, file_handle) ): -- Opens the file and calls callback on it. The 'data' argument is the data passed to save_atomic(). -- If the callback function throws an error, and strict loading is enabled, that error is propagated. -- The callback's first return value is returned by load_atomic -- Important: the callback must close the file in all cases! function serialize_lib.save_atomic(data, filename, callback, config) if serialize_lib.save_lock then serialize_lib.log_warn("Instructed to save '"..filename.."', but save lock is active!") return nil end local cbfunc = callback or ser.write_to_fd local file, ret = io.open(filename..".new", "w") if file then -- save the file using the callback local success success, ret = pcall(cbfunc, data, file) if success then return save_atomic_move_file(filename) end end serialize_lib.log_error("Unable to save data to '"..filename..".new':") serialize_lib.log_error(ret) return nil, ret end -- Saves multiple files synchronously. First writes all data to all <filename>.new files, -- then moves all files in quick succession to avoid inconsistent backups. -- parts_table is a table where the keys are used as part of the filename and the values -- are the respective data written to it. -- e.g. if parts_table={foo={...}, bar={...}}, then <filename_prefix>foo and <filename_prefix>bar are written out. -- if 'callbacks_table' is defined, it is consulted for callbacks the same way save_atomic does. -- example: if callbacks_table = {foo = func()...}, then the callback is used during writing of file 'foo' (but not for 'bar') -- Note however that you must at least insert a "true" in the parts_table if you don't use the data argument. -- Important: the callback must close the file in all cases! function serialize_lib.save_atomic_multiple(parts_table, filename_prefix, callbacks_table, config) if serialize_lib.save_lock then serialize_lib.log_warn("Instructed to save '"..filename_prefix.."' (multiple), but save lock is active!") return nil end for subfile, data in pairs(parts_table) do local filename = filename_prefix..subfile local cbfunc = ser.write_to_fd if callbacks_table and callbacks_table[subfile] then cbfunc = callbacks_table[subfile] end local success = false local file, ret = io.open(filename..".new", "w") if file then -- save the file using the callback success, ret = pcall(cbfunc, data, file, config) end if not success then serialize_lib.log_error("Unable to save data to '"..filename..".new':") serialize_lib.log_error(ret) return nil, ret end end local first_error for file, _ in pairs(parts_table) do local filename = filename_prefix..file local succ, err = save_atomic_move_file(filename) if not succ and not first_error then first_error = err end end return not first_error, first_error -- either true,nil or nil,error end