Mercurial > love-experiments
annotate src/scripts/boot.lua @ 1448:108ee2e81f65 default tip
Fix a case typo, imageData.h -> ImageData.h
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sat, 18 Jan 2014 13:57:44 +0100 |
| parents | f2be7a6a4d84 |
| children |
| rev | line source |
|---|---|
| 1096 | 1 --[[ |
|
1282
b7f097053d74
Updated copyright text for the new year
Alex Szpakowski <slime73@gmail.com>
parents:
1235
diff
changeset
|
2 Copyright (c) 2006-2013 LOVE Development Team |
| 1096 | 3 |
| 4 This software is provided 'as-is', without any express or implied | |
| 5 warranty. In no event will the authors be held liable for any damages | |
| 6 arising from the use of this software. | |
| 7 | |
| 8 Permission is granted to anyone to use this software for any purpose, | |
| 9 including commercial applications, and to alter it and redistribute it | |
| 10 freely, subject to the following restrictions: | |
| 11 | |
| 12 1. The origin of this software must not be misrepresented; you must not | |
| 13 claim that you wrote the original software. If you use this software | |
| 14 in a product, an acknowledgment in the product documentation would be | |
| 15 appreciated but is not required. | |
| 16 2. Altered source versions must be plainly marked as such, and must not be | |
| 17 misrepresented as being the original software. | |
| 18 3. This notice may not be removed or altered from any source distribution. | |
| 19 --]] | |
| 20 | |
| 21 -- Make sure love table exists. | |
| 22 if not love then love = {} end | |
| 23 | |
| 24 -- Used for setup: | |
| 25 love.path = {} | |
| 26 love.arg = {} | |
| 27 | |
| 28 -- Unparsed arguments: | |
| 29 argv = {} | |
| 30 | |
| 31 -- Replace any \ with /. | |
| 32 function love.path.normalslashes(p) | |
| 33 return string.gsub(p, "\\", "/") | |
| 34 end | |
| 35 | |
| 36 -- Makes sure there is a slash at the end | |
| 37 -- of a path. | |
| 38 function love.path.endslash(p) | |
| 39 if string.sub(p, string.len(p)-1) ~= "/" then | |
| 40 return p .. "/" | |
| 41 else | |
| 42 return p | |
| 43 end | |
| 44 end | |
| 45 | |
| 46 -- Checks whether a path is absolute or not. | |
| 47 function love.path.abs(p) | |
| 48 | |
| 49 local tmp = love.path.normalslashes(p) | |
| 50 | |
| 51 -- Path is absolute if it starts with a "/". | |
| 52 if string.find(tmp, "/") == 1 then | |
| 53 return true | |
| 54 end | |
| 55 | |
| 56 -- Path is absolute if it starts with a | |
| 57 -- letter followed by a colon. | |
| 58 if string.find(tmp, "%a:") == 1 then | |
| 59 return true | |
| 60 end | |
| 61 | |
| 62 -- Relative. | |
| 63 return false | |
| 64 | |
| 65 end | |
| 66 | |
| 67 -- Converts any path into a full path. | |
| 68 function love.path.getfull(p) | |
| 69 | |
| 70 if love.path.abs(p) then | |
| 71 return love.path.normalslashes(p) | |
| 72 end | |
| 73 | |
| 74 local cwd = love.filesystem.getWorkingDirectory() | |
| 75 cwd = love.path.normalslashes(cwd) | |
| 76 cwd = love.path.endslash(cwd) | |
| 77 | |
| 78 -- Construct a full path. | |
| 79 local full = cwd .. love.path.normalslashes(p) | |
| 80 | |
| 81 -- Remove trailing /., if applicable | |
| 82 return full:match("(.-)/%.$") or full | |
| 83 end | |
| 84 | |
| 85 -- Returns the leaf of a full path. | |
| 86 function love.path.leaf(p) | |
| 87 local a = 1 | |
| 88 local last = p | |
| 89 | |
| 90 while a do | |
| 91 a = string.find(p, "/", a+1) | |
| 92 | |
| 93 if a then | |
| 94 last = string.sub(p, a+1) | |
| 95 end | |
| 96 end | |
| 97 | |
| 98 return last | |
| 99 end | |
| 100 | |
| 101 -- Finds the key in the table with the lowest integral index. The lowest | |
| 102 -- will typically the executable, for instance "lua5.1.exe". | |
| 103 function love.arg.getLow(a) | |
| 104 local m = math.huge | |
| 105 for k,v in pairs(a) do | |
| 106 if k < m then | |
| 107 m = k | |
| 108 end | |
| 109 end | |
| 110 return a[m] | |
| 111 end | |
| 112 | |
| 113 love.arg.options = { | |
| 114 console = { a = 0 }, | |
| 115 fused = {a = 0 }, | |
| 116 game = { a = 1 } | |
| 117 } | |
| 118 | |
| 119 function love.arg.parse_option(m, i) | |
| 120 m.set = true | |
| 121 | |
| 122 if m.a > 0 then | |
| 123 m.arg = {} | |
| 124 for j=i,i+m.a-1 do | |
| 125 table.insert(m.arg, arg[j]) | |
| 126 i = j | |
| 127 end | |
| 128 end | |
| 129 | |
| 130 return i | |
| 131 end | |
| 132 | |
| 133 function love.arg.parse_options() | |
| 134 | |
| 135 local game | |
| 136 local argc = #arg | |
| 137 | |
| 138 for i=1,argc do | |
| 139 -- Look for options. | |
| 140 local s, e, m = string.find(arg[i], "%-%-(.+)") | |
| 141 | |
| 142 if m and love.arg.options[m] then | |
| 143 i = love.arg.parse_option(love.arg.options[m], i+1) | |
| 144 elseif not game then | |
| 145 game = i | |
| 146 end | |
| 147 end | |
| 148 | |
| 149 if not love.arg.options.game.set then | |
| 150 love.arg.parse_option(love.arg.options.game, game or 0) | |
| 151 end | |
| 152 end | |
| 153 | |
| 154 function love.createhandlers() | |
| 155 | |
| 156 -- Standard callback handlers. | |
| 157 love.handlers = setmetatable({ | |
| 158 keypressed = function (b, u) | |
| 159 if love.keypressed then love.keypressed(b, u) end | |
| 160 end, | |
| 161 keyreleased = function (b) | |
| 162 if love.keyreleased then love.keyreleased(b) end | |
| 163 end, | |
| 164 mousepressed = function (x,y,b) | |
| 165 if love.mousepressed then love.mousepressed(x,y,b) end | |
| 166 end, | |
| 167 mousereleased = function (x,y,b) | |
| 168 if love.mousereleased then love.mousereleased(x,y,b) end | |
| 169 end, | |
| 170 joystickpressed = function (j,b) | |
| 171 if love.joystickpressed then love.joystickpressed(j,b) end | |
| 172 end, | |
| 173 joystickreleased = function (j,b) | |
| 174 if love.joystickreleased then love.joystickreleased(j,b) end | |
| 175 end, | |
|
1347
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
176 joystickaxis = function (j,a,v) |
|
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
177 if love.joystickaxis then love.joystickaxis(j,a,v) end |
|
1344
2e0c6688bd42
Added love.joystickaxismoved, love.joystickballmoved, and love.joystickhatmoved callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1333
diff
changeset
|
178 end, |
|
1347
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
179 joystickball = function (j,b,dx,dy) |
|
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
180 if love.joystickball then love.joystickball(j,b,dx,dy) end |
|
1344
2e0c6688bd42
Added love.joystickaxismoved, love.joystickballmoved, and love.joystickhatmoved callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1333
diff
changeset
|
181 end, |
|
1347
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
182 joystickhat = function(j,h,v) |
|
43ac6da59125
Removed 'moved' suffix from new joystick callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1344
diff
changeset
|
183 if love.joystickhat then love.joystickhat(j,h,v) end |
|
1344
2e0c6688bd42
Added love.joystickaxismoved, love.joystickballmoved, and love.joystickhatmoved callbacks
Alex Szpakowski <slime73@gmail.com>
parents:
1333
diff
changeset
|
184 end, |
| 1096 | 185 focus = function (f) |
| 186 if love.focus then love.focus(f) end | |
| 187 end, | |
| 188 quit = function () | |
| 189 return | |
| 190 end, | |
|
1111
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
191 resize = function(w, h) |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
192 local ow, oh, flags = love.graphics.getMode() |
|
1441
f2be7a6a4d84
Potentially worked around an SDL resize event bug in windows causing initial window creation to happen twice
Alex Szpakowski <slime73@gmail.com>
parents:
1439
diff
changeset
|
193 if flags.resizable then |
|
f2be7a6a4d84
Potentially worked around an SDL resize event bug in windows causing initial window creation to happen twice
Alex Szpakowski <slime73@gmail.com>
parents:
1439
diff
changeset
|
194 love.graphics.setMode(w, h, flags) |
|
f2be7a6a4d84
Potentially worked around an SDL resize event bug in windows causing initial window creation to happen twice
Alex Szpakowski <slime73@gmail.com>
parents:
1439
diff
changeset
|
195 if love.resize then love.resize(w, h) end |
|
f2be7a6a4d84
Potentially worked around an SDL resize event bug in windows causing initial window creation to happen twice
Alex Szpakowski <slime73@gmail.com>
parents:
1439
diff
changeset
|
196 end |
|
1111
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
197 end, |
| 1096 | 198 }, { |
| 199 __index = function(self, name) | |
| 200 error("Unknown event: " .. name) | |
| 201 end, | |
| 202 }) | |
| 203 | |
| 204 end | |
| 205 | |
| 206 local is_fused_game = false | |
| 207 local no_game_code = false | |
| 208 | |
| 209 -- This can't be overriden. | |
| 210 function love.boot() | |
| 211 | |
| 212 -- This is absolutely needed. | |
| 213 require("love") | |
| 214 require("love.filesystem") | |
| 215 | |
| 216 love.arg.parse_options() | |
| 217 | |
| 218 local o = love.arg.options | |
| 219 | |
| 220 local arg0 = love.arg.getLow(arg) | |
| 221 love.filesystem.init(arg0) | |
| 222 | |
| 223 -- Is this one of those fancy "fused" games? | |
| 224 local can_has_game = pcall(love.filesystem.setSource, arg0) | |
| 225 is_fused_game = can_has_game | |
| 226 if love.arg.options.fused.set then | |
| 227 is_fused_game = true | |
| 228 end | |
| 229 | |
| 230 if not can_has_game and o.game.set and o.game.arg[1] then | |
| 231 local nouri = o.game.arg[1] | |
| 232 if nouri:sub(1, 7) == "file://" then | |
| 233 nouri = nouri:sub(8) | |
| 234 end | |
| 235 local full_source = love.path.getfull(nouri) | |
| 236 local leaf = love.path.leaf(full_source) | |
| 237 love.filesystem.setIdentity(leaf) | |
| 238 can_has_game = pcall(love.filesystem.setSource, full_source) | |
| 239 end | |
| 240 | |
| 241 if can_has_game and not (love.filesystem.exists("main.lua") or love.filesystem.exists("conf.lua")) then | |
| 242 no_game_code = true | |
| 243 end | |
| 244 | |
| 245 if not can_has_game then | |
| 246 love.nogame() | |
| 247 end | |
| 248 | |
| 249 end | |
| 250 | |
| 251 function love.init() | |
| 252 | |
| 253 -- Create default configuration settings. | |
| 254 -- NOTE: Adding a new module to the modules list | |
| 255 -- will NOT make it load, see below. | |
| 256 local c = { | |
| 257 title = "Untitled", | |
| 258 author = "Unnamed", | |
| 259 version = love._version, | |
| 260 screen = { | |
| 261 width = 800, | |
| 262 height = 600, | |
| 263 fullscreen = false, | |
| 264 vsync = true, | |
| 265 fsaa = 0, | |
|
1356
9115e52f5350
Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1347
diff
changeset
|
266 borderless = false, |
|
9115e52f5350
Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1347
diff
changeset
|
267 resizable = false, |
|
9115e52f5350
Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1347
diff
changeset
|
268 centered = true, |
| 1096 | 269 }, |
| 270 modules = { | |
| 271 event = true, | |
| 272 keyboard = true, | |
| 273 mouse = true, | |
| 274 timer = true, | |
| 275 joystick = true, | |
| 276 image = true, | |
| 277 graphics = true, | |
| 278 audio = true, | |
|
1323
20219e80cb9f
Add module `love.math`. Implements xorshift RNG.
vrld <vrld@vrld.org>
parents:
1282
diff
changeset
|
279 math = true, |
| 1096 | 280 physics = true, |
| 281 sound = true, | |
| 282 font = true, | |
| 283 thread = true, | |
| 284 }, | |
| 285 console = false, -- Only relevant for windows. | |
| 286 identity = false, | |
| 287 release = false, | |
| 288 } | |
| 289 | |
| 290 -- If config file exists, load it and allow it to update config table. | |
| 291 if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then | |
| 292 require("conf") | |
| 293 end | |
| 294 | |
| 295 -- Yes, conf.lua might not exist, but there are other ways of making | |
| 296 -- love.conf appear, so we should check for it anyway. | |
| 297 if love.conf then | |
| 298 local ok, err = pcall(love.conf, c) | |
| 299 if not ok then | |
| 300 print(err) | |
| 301 -- continue | |
| 302 end | |
| 303 end | |
| 304 | |
| 305 if c.release then | |
| 306 love._release = { | |
| 307 title = c.title ~= "Untitled" and c.title or nil, | |
| 308 author = c.author ~= "Unnamed" and c.author or nil, | |
| 309 url = c.url | |
| 310 } | |
| 311 end | |
| 312 | |
| 313 if love.arg.options.console.set then | |
| 314 c.console = true | |
| 315 end | |
| 316 | |
| 317 -- Gets desired modules. | |
| 318 for k,v in ipairs{ | |
| 319 "thread", | |
| 320 "timer", | |
| 321 "event", | |
| 322 "keyboard", | |
| 323 "joystick", | |
| 324 "mouse", | |
| 325 "sound", | |
| 326 "audio", | |
| 327 "image", | |
| 328 "font", | |
| 329 "graphics", | |
|
1323
20219e80cb9f
Add module `love.math`. Implements xorshift RNG.
vrld <vrld@vrld.org>
parents:
1282
diff
changeset
|
330 "math", |
| 1096 | 331 "physics", |
| 332 } do | |
| 333 if c.modules[v] then | |
| 334 require("love." .. v) | |
| 335 end | |
| 336 end | |
| 337 | |
| 338 if love.event then | |
| 339 love.createhandlers() | |
| 340 end | |
| 341 | |
| 342 -- Setup screen here. | |
|
1144
ab6a48fbdd3c
Fix bug where the compat message crashed love.
vrld <vrld@vrld.org>
parents:
1133
diff
changeset
|
343 local has_window = false |
| 1096 | 344 if c.screen and c.modules.graphics then |
| 345 if love.graphics.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then | |
|
1111
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
346 assert(love.graphics.setMode(c.screen.width, c.screen.height, |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
347 { |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
348 fullscreen = c.screen.fullscreen, |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
349 vsync = c.screen.vsync, |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
350 fsaa = c.screen.fsaa, |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
351 resizable = c.screen.resizable, |
|
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
352 borderless = c.screen.borderless, |
|
1356
9115e52f5350
Add centered flag to setMode, optionally centers the window (on by default, as before) (issue #463)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1347
diff
changeset
|
353 centered = c.screen.centered, |
|
1111
9a6a533ac832
Use a flags table for setMode now, implement resizable and borderless windows, and add resize event
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
354 }), "Could not set screen mode") |
| 1096 | 355 else |
| 356 error("Could not set screen mode") | |
| 357 end | |
| 358 love.graphics.setCaption(c.title) | |
| 359 end | |
| 360 | |
| 361 -- Our first timestep, because screen creation can take some time | |
| 362 if love.timer then | |
| 363 love.timer.step() | |
| 364 end | |
| 365 | |
| 366 if love.filesystem then | |
| 367 love.filesystem.setRelease(c.release and is_fused_game) | |
| 368 if c.identity then love.filesystem.setIdentity(c.identity) end | |
| 369 if love.filesystem.exists("main.lua") then require("main") end | |
| 370 end | |
| 371 | |
| 372 if no_game_code then | |
| 373 error("No code to run\nYour game might be packaged incorrectly\nMake sure main.lua is at the top level of the zip") | |
| 374 end | |
| 375 | |
| 376 -- Console hack | |
| 377 if c.console and love._openConsole then | |
| 378 love._openConsole() | |
| 379 end | |
| 380 | |
| 381 -- Check the version | |
| 382 local compat = false | |
| 383 c.version = tostring(c.version) | |
| 384 for i, v in ipairs(love._version_compat) do | |
| 385 if c.version == v then | |
| 386 compat = true | |
| 387 break | |
| 388 end | |
| 389 end | |
| 390 if not compat then | |
| 391 local major, minor, revision = c.version:match("^(%d+)%.(%d+)%.(%d+)$") | |
| 392 if (not major or not minor or not revision) or (major ~= love._version_major and minor ~= love._version_minor) then | |
| 393 local msg = "This game was made for a version that is probably incompatible.\n".. | |
| 394 "The game might still work, but it is not guaranteed.\n" .. | |
| 395 "Furthermore, this means one should not judge this game or the engine if not." | |
| 396 print(msg) | |
|
1144
ab6a48fbdd3c
Fix bug where the compat message crashed love.
vrld <vrld@vrld.org>
parents:
1133
diff
changeset
|
397 if has_window and love.timer and love.event then |
| 1096 | 398 love.event.pump() |
| 399 love.graphics.setBackgroundColor(89, 157, 220) | |
| 400 love.graphics.clear() | |
|
1321
30d0e4cb3d2b
Added love.graphics.origin(): resets the coordinate system (replaces the current transformation matrix with the identity)
Alex Szpakowski <slime73@gmail.com>
parents:
1282
diff
changeset
|
401 love.graphics.origin() |
| 1096 | 402 love.graphics.print(msg, 70, 70) |
| 403 love.graphics.present() | |
| 404 love.graphics.setBackgroundColor(0, 0, 0) | |
| 405 love.timer.sleep(3) | |
| 406 end | |
| 407 end | |
| 408 end | |
| 409 | |
| 410 end | |
| 411 | |
| 412 function love.run() | |
| 413 | |
| 414 math.randomseed(os.time()) | |
| 415 math.random() math.random() | |
| 416 | |
| 417 if love.load then love.load(arg) end | |
| 418 | |
| 419 local dt = 0 | |
| 420 | |
| 421 -- Main loop time. | |
| 422 while true do | |
| 423 -- Process events. | |
| 424 if love.event then | |
| 425 love.event.pump() | |
| 426 for e,a,b,c,d in love.event.poll() do | |
| 427 if e == "quit" then | |
| 428 if not love.quit or not love.quit() then | |
| 429 if love.audio then | |
| 430 love.audio.stop() | |
| 431 end | |
| 432 return | |
| 433 end | |
| 434 end | |
| 435 love.handlers[e](a,b,c,d) | |
| 436 end | |
| 437 end | |
| 438 | |
| 439 -- Update dt, as we'll be passing it to update | |
| 440 if love.timer then | |
| 441 love.timer.step() | |
| 442 dt = love.timer.getDelta() | |
| 443 end | |
| 444 | |
| 445 -- Call update and draw | |
| 446 if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled | |
| 447 if love.graphics then | |
| 448 love.graphics.clear() | |
|
1321
30d0e4cb3d2b
Added love.graphics.origin(): resets the coordinate system (replaces the current transformation matrix with the identity)
Alex Szpakowski <slime73@gmail.com>
parents:
1282
diff
changeset
|
449 love.graphics.origin() |
| 1096 | 450 if love.draw then love.draw() end |
| 451 end | |
| 452 | |
|
1133
7338252337c9
love.run(): Sleep after presenting graphics buffer.
vrld <vrld@vrld.org>
parents:
1096
diff
changeset
|
453 if love.graphics then love.graphics.present() end |
| 1096 | 454 if love.timer then love.timer.sleep(0.001) end |
| 455 | |
| 456 end | |
| 457 | |
| 458 end | |
| 459 | |
| 460 ----------------------------------------------------------- | |
| 461 -- Default screen. | |
| 462 ----------------------------------------------------------- | |
| 463 | |
| 464 function love.nogame() | |
| 465 local pig_png = | |
| 466 "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\ | |
| 467 bWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp\ | |
| 468 bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6\ | |
| 469 eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwI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9AZAOl9N2AAh+ANJjMc5goAkBuIw6ACBVKqkIANt/7PcHwNE0IK4DgP0HIH3moh4YElcA\ | |
| 521 YP8BkEE5UQHggQfYfwBkcClpBwD7D0BeHYDmAsocADHMRjkyLI4AlFHmALjtAiIJAOf/JZQ3AKI4\ | |
| 522 n5QDwOAfAPKYS0oAYP8BkEcp7LLgqAJwHmUNgPsuIKoA4MIPAHIsAEgBAJCJ3RTA5JnkAADjXLAq\ | |
| 523 AAozAABkhiKKAACMAYShhDIGIKdjABAAAJACAAAgAAAACAAAQAxhtgVDAACAAwAAZIgWBACAnHLm\ | |
| 524 5nIHAgAAsCIAHRQbAPkVgBaKDYD8CgAAQC5N2wLQRhkDkFMHcObmMgQAALmEStGnI/4SEoESytod\ | |
| 525 CqefUIWZqeP/9uRJVTh1cuh79u9/1v9vD75S6tFjFKhcPoUA5M3GPf+UUiemVfHME/p1ygt279/p\ | |
| 526 tSfowzD15osj//+BFoMDEoPdPf31Q/31XvffvnikDr78GhXjwBhAVAHYVjgXMJVA93pt6s31EzfA\ | |
| 527 jbgK/z9ePj1YILQQkDiQm4B7SIR2EgKAcQDbwcWB7gU9vzqZdpBIaXHw3URXEL7SgvC599DXwBxh\ | |
| 528 x+iiCgDWAtjo4XWgUKD7QZ9ZYdNP0XcM2hHs//KzriB81EHqkKD9jywAWmVaOxdrtCLQ6gnBD/cf\ | |
| 529 qZ98eUc//6fuPdo5/hmmT6lz33xFvf3kq+rlmTNuVpe271MU9N+ePQqIvKHLwBM++vvfesUTABKC\ | |
| 530 x+9/4qQ7oDb7zsMPvTb73q8/7muzr598Qb196lXv1QLbiQhAQG0WbRXkP356W219/r9egQ5iZ+8L\ | |
| 531 1dT/n563n3xN/fD099Q3izMI+gw4hKk3nveeQzF4974TzoAC/+9/9W8j2+xP9u54ndrr33hB/cns\ | |
| 532 90x3Xq0kBWDbhgBQ4f3NL/+pr8cfBRUoFf6fP/eHYt0AWXqvYVPQpzhw56wYaDdAQkDOQCIU+NQO\ | |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610 gAEwAAbAABgAA2AADIABMAAG0EcbmtzkeV7p9Z+nVQhViB8PUNK7j+nBxkF4ZgzVHMp9ydeZfAeU\ | |
| 611 d3hPVnZ/3X6HZ7IhUgQATgZQraEEJT+XDi7AwVQzcB+qjQK0zuTzJ0Xg5ACw1aWjfs1tCTg30wh+\ | |
| 612 XwH0nOVQIlUNpACw5fcNglclKx3MCYJXIYxOSqiLb2CRm75m8AKD+kJwVba2CF6gP+s2RoGlZvCq\ | |
| 613 g/syCHDtFaqxg849hGeNyQDAw2WPHFu20gZVpKbT3OEI90ypgKkDB+9RCScIG8dDfCMFDE0l5shJ\ | |
| 614 2epLgPBdMc5bGaoqowAQOPQzFnTmU6XAVViTydctA2g0Bb9lAGnfAewoAaQdDz6H/N9SAth1HMCK\ | |
| 615 eiq87XLry5UnKQBcaXUVwurcatNlJzi79ta3AoAqSDoGYKHT+tYbIjjf/nQ8NTa1DIIfFS+SbYgo\ | |
| 616 9ojSu7RNTG6yBoCpEF0YwqJqV5g8BQpLT90tMjLpt5kCJyVkqIRDi8HnptInWQsghFHdJoRDm5lK\ | |
| 617 n2wxhMOQVMIbcfDynMH6Hc76gDKDfuFF/O0eO1/qQvBRkx+21gdUqCHBlHDZL2Q49Dox8v0ApV9I\ | |
| 618 HAUf6c72LpYCJSkRYkoEbQXfyumwAYhYVB95O235TgIogJjWKCKVOW8q+04DKMwi5UnOg/g/dMlx\ | |
| 619 imvVd5AAuCXjP0kxAAbAABgAA2AADIABMAAGwAB6ab8CDACjlPepVvE3rwAAAABJRU5ErkJggg==" | |
| 620 | |
| 621 local hearts = {} | |
| 622 local rings = {} | |
| 623 | |
| 624 local cx = 400 | |
| 625 local cy = 300 | |
| 626 | |
| 627 local pig | |
| 628 local heart_image | |
| 629 | |
| 630 local function add_heart_ring(radius, number, speed) | |
| 631 local step = math.pi*2/number | |
| 632 for i = 1,number do | |
| 633 local heart = { | |
| 634 radius = radius, | |
| 635 position = step*i, | |
| 636 speed = speed, | |
| 637 opacity = radius/450 | |
| 638 } | |
| 639 table.insert(hearts, heart) | |
| 640 end | |
| 641 table.insert(rings, radius) | |
| 642 end | |
| 643 | |
| 644 local function update_hearts(dt) | |
| 645 for i,v in ipairs(hearts) do | |
| 646 v.position = v.position + v.speed*dt*0.6 | |
| 647 end | |
| 648 end | |
| 649 | |
| 650 local function draw_hearts() | |
| 651 for i,v in ipairs(hearts) do | |
| 652 local x = math.cos(v.position) * v.radius + cx | |
| 653 local y = math.sin(v.position) * v.radius + cy | |
| 654 love.graphics.setColor(255, 255, 255, v.opacity*255) | |
| 655 love.graphics.draw(heart_image, x, y, v.position+0.4, 1, 1, 32, 32) | |
| 656 end | |
| 657 end | |
| 658 | |
| 659 local function draw_pig(p) | |
| 660 love.graphics.setColor(255, 255, 255, 255) | |
| 661 love.graphics.draw(p.img, p.x, p.y, 0, 1, 1, 128, 128) | |
| 662 end | |
| 663 | |
| 664 local function loadimage(file, name) | |
| 665 return love.graphics.newImage(love.image.newImageData(love.filesystem.newFileData(file, name:gsub("_", "."), "base64"))) | |
| 666 end | |
| 667 | |
| 668 function love.load() | |
| 669 math.randomseed(os.time()) | |
| 670 pig = { | |
| 671 x = cx, | |
| 672 y = cy, | |
| 673 img = loadimage(pig_png, "pig.png") | |
| 674 } | |
| 675 heart_image = loadimage(heart_png, "heart.png") | |
| 676 | |
| 677 add_heart_ring(100, 10, 2.4) | |
| 678 add_heart_ring(150, 20, 2.2) | |
| 679 add_heart_ring(200, 25, 2.0) | |
| 680 add_heart_ring(250, 35, 1.8) | |
| 681 add_heart_ring(300, 40, 1.6) | |
| 682 add_heart_ring(350, 50, 1.4) | |
| 683 add_heart_ring(400, 60, 1.2) | |
| 684 add_heart_ring(450, 70, 1) | |
| 685 end | |
| 686 | |
| 687 function love.update(dt) | |
| 688 update_hearts(dt) | |
| 689 end | |
| 690 | |
| 691 function love.draw() | |
| 692 love.graphics.setBackgroundColor(254, 224, 238) | |
| 693 draw_hearts() | |
| 694 draw_pig(pig) | |
| 695 end | |
| 696 | |
| 697 function love.keyreleased(key) | |
| 698 if key == "escape" then | |
| 699 love.event.quit() | |
| 700 end | |
| 701 end | |
| 702 | |
| 703 function love.conf(t) | |
| 704 t.title = "L\195\150VE " .. love._version .. " (" .. love._version_codename .. ")" | |
| 705 t.modules.audio = false | |
| 706 t.modules.sound = false | |
| 707 t.modules.physics = false | |
| 708 t.modules.joystick = false | |
| 709 end | |
| 710 end | |
| 711 | |
| 712 ----------------------------------------------------------- | |
| 713 -- Error screen. | |
| 714 ----------------------------------------------------------- | |
| 715 | |
|
1189
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
716 local debug, print = debug, print |
| 1096 | 717 |
| 718 local function error_printer(msg, layer) | |
| 719 print((debug.traceback("Error: " .. tostring(msg), 1+(layer or 1)):gsub("\n[^\n]+$", ""))) | |
| 720 end | |
| 721 | |
| 722 function love.errhand(msg) | |
| 723 msg = tostring(msg) | |
| 724 | |
| 725 error_printer(msg, 2) | |
| 726 | |
| 727 if not love.graphics or not love.event or not love.graphics.isCreated() then | |
| 728 return | |
| 729 end | |
| 730 | |
| 731 -- Load. | |
| 732 if love.audio then love.audio.stop() end | |
| 733 love.graphics.reset() | |
| 734 love.graphics.setBackgroundColor(89, 157, 220) | |
| 735 local font = love.graphics.newFont(14) | |
| 736 love.graphics.setFont(font) | |
| 737 | |
| 738 love.graphics.setColor(255, 255, 255, 255) | |
| 739 | |
| 740 local trace = debug.traceback() | |
| 741 | |
| 742 love.graphics.clear() | |
|
1321
30d0e4cb3d2b
Added love.graphics.origin(): resets the coordinate system (replaces the current transformation matrix with the identity)
Alex Szpakowski <slime73@gmail.com>
parents:
1282
diff
changeset
|
743 love.graphics.origin() |
| 1096 | 744 |
| 745 local err = {} | |
| 746 | |
| 747 table.insert(err, "Error\n") | |
| 748 table.insert(err, msg.."\n\n") | |
| 749 | |
| 750 for l in string.gmatch(trace, "(.-)\n") do | |
| 751 if not string.match(l, "boot.lua") then | |
| 752 l = string.gsub(l, "stack traceback:", "Traceback\n") | |
| 753 table.insert(err, l) | |
| 754 end | |
| 755 end | |
| 756 | |
| 757 local p = table.concat(err, "\n") | |
| 758 | |
| 759 p = string.gsub(p, "\t", "") | |
| 760 p = string.gsub(p, "%[string \"(.-)\"%]", "%1") | |
| 761 | |
| 762 local function draw() | |
| 763 love.graphics.clear() | |
| 764 love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) | |
| 765 love.graphics.present() | |
| 766 end | |
| 767 | |
| 768 draw() | |
| 769 | |
| 770 local e, a, b, c | |
| 771 while true do | |
| 772 e, a, b, c = love.event.wait() | |
| 773 | |
| 774 if e == "quit" then | |
| 775 return | |
| 776 end | |
| 777 if e == "keypressed" and a == "escape" then | |
| 778 return | |
| 779 end | |
| 780 | |
| 781 draw() | |
| 782 | |
| 783 end | |
| 784 | |
| 785 end | |
| 786 | |
| 787 function love.releaseerrhand(msg) | |
| 788 print("An error has occured, the game has been stopped.") | |
| 789 | |
| 790 if not love.graphics or not love.event or not love.graphics.isCreated() then | |
| 791 return | |
| 792 end | |
| 793 | |
| 794 love.graphics.setCanvas() | |
|
1233
1cb8b929f662
Renamed all instances of 'ShaderEffect' (previously 'PixelEffect') to 'Shader'.
Alexander Szpakowski <amaranth72@gmail.com>
parents:
1200
diff
changeset
|
795 love.graphics.setShader() |
| 1096 | 796 |
| 797 -- Load. | |
| 798 if love.audio then love.audio.stop() end | |
| 799 love.graphics.reset() | |
| 800 love.graphics.setBackgroundColor(89, 157, 220) | |
| 801 local font = love.graphics.newFont(14) | |
| 802 love.graphics.setFont(font) | |
| 803 | |
| 804 love.graphics.setColor(255, 255, 255, 255) | |
| 805 | |
| 806 love.graphics.clear() | |
|
1321
30d0e4cb3d2b
Added love.graphics.origin(): resets the coordinate system (replaces the current transformation matrix with the identity)
Alex Szpakowski <slime73@gmail.com>
parents:
1282
diff
changeset
|
807 love.graphics.origin() |
| 1096 | 808 |
| 809 local err = {} | |
| 810 | |
| 811 p = string.format("An error has occured that caused %s to stop.\nYou can notify %s about this%s.", love._release.title or "this game", love._release.author or "the author", love._release.url and " at " .. love._release.url or "") | |
| 812 | |
| 813 local function draw() | |
| 814 love.graphics.clear() | |
| 815 love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) | |
| 816 love.graphics.present() | |
| 817 end | |
| 818 | |
| 819 draw() | |
| 820 | |
| 821 local e, a, b, c | |
| 822 while true do | |
| 823 e, a, b, c = love.event.wait() | |
| 824 | |
| 825 if e == "quit" then | |
| 826 return | |
| 827 end | |
| 828 if e == "keypressed" and a == "escape" then | |
| 829 return | |
| 830 end | |
| 831 | |
| 832 draw() | |
| 833 | |
| 834 end | |
| 835 end | |
| 836 | |
|
1189
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
837 local function deferErrhand(...) |
|
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
838 local handler = ((love._release and love.releaseerrhand) or love.errhand or error_printer) |
|
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
839 return handler(...) |
|
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
840 end |
|
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
841 |
| 1096 | 842 |
| 843 ----------------------------------------------------------- | |
| 844 -- The root of all calls. | |
| 845 ----------------------------------------------------------- | |
| 846 | |
| 847 return function() | |
| 848 local result = xpcall(love.boot, error_printer) | |
| 849 if not result then return 1 end | |
|
1189
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
850 local result = xpcall(love.init, deferErrhand) |
| 1096 | 851 if not result then return 1 end |
|
1189
2e57cc4b8749
Make sure love.errhand gets a local reference to print as well, and find the error handler at errortime (partial #390)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1144
diff
changeset
|
852 local result, retval = xpcall(love.run, deferErrhand) |
| 1096 | 853 if not result then return 1 end |
| 854 | |
| 855 return tonumber(retval) or 0 | |
| 856 end |
