Commit graph

70 commits

Author SHA1 Message Date
Andrei Alexeyev
513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
f8cf13bdf3
more efficient FBO handling 2018-01-03 16:38:42 +02:00
Andrei Alexeyev
14e750fde0
ensure only locale-independent format strings are used with strftime
affects filenames of replays and screenshots
2017-12-31 10:00:12 +02:00
Andrei Alexeyev
0dd09c9a1c
add version string to window title 2017-12-28 09:29:17 +02:00
Andrei Alexeyev
d66793a117
add option to swap buffers after waiting for next frame
also restructured loop_at_fps a bit. it now handles FPS counter updates
and buffer swaps.
2017-12-26 10:56:21 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
de2223d800
add option to disable pause on focus loss
ping @makise-homura
2017-11-24 16:39:07 +02:00
Andrei Alexeyev
4b53d65c23
enable GL_TEXTURE_2D by default to reduce API calls 2017-11-22 02:05:42 +02:00
Andrei Alexeyev
fc57c9fe84
more robust sdl videodriver selection 2017-11-11 21:37:24 +02:00
Andrei Alexeyev
499259512b
fix fullscreen/window management issues 2017-11-11 20:47:32 +02:00
Andrei Alexeyev
b61ef0bffc
more strict warnings; fixed some subtle bugs 2017-11-11 19:33:44 +02:00
Andrei Alexeyev
62c34e3b5a
WIP fucking badass Marisa lasers 2017-10-31 08:57:32 +02:00
Andrei Alexeyev
ef67a16867
WIP event system rewrite. text input missing 2017-10-01 00:43:18 +03:00
Andrei "Akari" Alexeyev
0dba761251
config changes
* Added a versioned upgrade mechanism
    * Made values of vsync 66% less confusing
    * Defaulted vsync to off, since it seems to cause input delays for
    some people.
    * Don't shout warnings when the config file doesn't exist, this is
    not something to panic about.
2017-09-27 01:03:16 +03:00
Andrei "Akari" Alexeyev
c0e9d50cf4
more small video fixes 2017-09-19 17:54:48 +03:00
Andrei "Akari" Alexeyev
73db5677c2
video: api cleanup 2017-09-19 17:12:55 +03:00
Andrei "Akari" Alexeyev
99adcc9afe
fix fullscreen config handling 2017-09-19 17:05:53 +03:00
Andrei "Akari" Alexeyev
8aa6f8ea64
video hacks 2017-09-19 15:13:04 +03:00
Andrei "Akari" Alexeyev
c199ce6fa6
use desktop mode fullscreen by default
also fixed the userevent in resources to use the correct id
2017-09-18 14:19:50 +03:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
250c4c0821 Merge branch 'master' into vfs 2017-05-05 19:37:33 +03:00
Andrei "Akari" Alexeyev
276e730900 naming 2017-05-05 04:49:00 +03:00
Andrei "Akari" Alexeyev
15822de2f8 prioritize other video drivers over x11 if possible 2017-05-05 04:36:27 +03:00
Andrei "Akari" Alexeyev
02680a6dbd Merge branch 'master' into vfs 2017-05-04 17:02:22 +03:00
Andrei "Akari" Alexeyev
5e06c12fbb fixed some bugs with the resizable window options 2017-05-03 17:14:38 +03:00
Andrei "Akari" Alexeyev
8db701bc05 better representation API and error messages for union mounts 2017-04-27 12:10:49 +03:00
Andrei "Akari" Alexeyev
471f30083e WIP virtual filesystem 2017-04-20 05:02:22 +03:00
Andrei "Akari" Alexeyev
10b86bcd3c Merge branch 'quality' 2017-04-19 21:38:35 +03:00
laochailan
8ea9cff499 rescale the fbo so it’s always rendered pixel perfectly 2017-04-19 09:56:18 +02:00
Andrei "Akari" Alexeyev
dc3aaf187b use extensions for GL debugging
this allows debugging to be enabled in pre-4.3 contexts
2017-04-19 00:48:07 +03:00
Andrei "Akari" Alexeyev
66411f7047 updated the log message in video_update_quality 2017-04-16 01:04:21 +03:00
Andrei "Akari" Alexeyev
3f1119340e dynamic quality scaling for fonts
not sure if i'm actually doing it right. but seems to look okay, unless
i manually resize the window to something weird, then it can get blurry.
2017-04-16 01:00:43 +03:00
Andrei "Akari" Alexeyev
53c0d9ca5e WIP: dynamic quality scaling and better quality settings 2017-04-08 21:48:40 +03:00
Andrei "Akari" Alexeyev
20857176e4 minor issues 2017-04-01 03:08:35 +03:00
laochailan
2dd7dbe504 free fonts in the right place 2017-03-28 18:03:33 +02:00
laochailan
b804f53a45 Font rendering speedup
We now use a single texture for all text rendering instead of
generating/freeing textures for every bit of text.
2017-03-28 16:52:53 +02:00
Andrei "Akari" Alexeyev
10138c4632 fixed screenshots, apparently 2017-03-25 20:59:36 +02:00
Andrei "Akari" Alexeyev
5ad246b791 Added more information to the init log
mainly versions of used libraries
2017-03-20 08:08:09 +02:00
Andrei "Akari" Alexeyev
3d5344de3b Renamed log_err to log_fatal 2017-03-13 18:03:51 +02:00
Andrei "Akari" Alexeyev
45da155cb2 Implemented a simple and consistent logging subsystem
The goal of this change is mainly to clean up Taisei's codebase and
improve its console output. I've been frustrated by files littered with
inconsistent printf/fprintf/warnx/errx calls for a long time, and now I
actually did something about it.

All the above functions are now considered deprecated and result in a
compile-time warning when used. Instead, the following macros should be
used:

    log_debug(format, ...)
    log_info(format, ...)
    log_warn(format, ...)
    log_err(format, ...)

As you can see, all of them have the same printf-like interface. But
they have different functionality and purpose:

    log_debug is intended for very verbose and specific information. It
    does nothing in release builds, much like assert(), so don't use
    expressions with side-effects in its arguments.

    log_info is for various status updates that are expected during
    normal operation of the program.

    log_warn is for non-critical failures or other things that may be
    worth investigating, but don't inherently render the program
    non-functional.

    log_err is for when the only choice is to give up. Like errx, it
    also terminates the program. Unlike errx, it actually calls abort(),
    which means the cleanup functions are not ran -- but on the other
    hand, you get a debuggable backtrace. However, if you're trying to
    catch programming errors, consider using assert() instead.

All of them produce output that contains a timestamp, the log level
identifier, the calling function's name, and the formatted message.

The newline at the end of the format string is not required -- no, it is
actually *prohibited*. The logging system will take care of the line
breaks by itself, don't litter the code with that shit.

Internally, the logging system is based on the SDL_RWops abstraction,
and may have multiple, configurable destinations. This makes it easily
extensible. Currently, log_debug and log_info are set to write to
stdout, log_warn and log_err to stderr, and all of them also to the file
log.txt in the Taisei config directory.

Consequently, the nasty freopen hacks we used to make Taisei write to
log files on Windows are no longer needed -- which is a very good thing,
considering they probably would break if the configdir path contains
UTF-8 characters. SDL_RWFromFile does not suffer this limitation.

As an added bonus, it's also thread-safe.

Note about printf and fprintf: in very few cases, the logging system is
not a good substitute for these functions. That is, when you care about
writing exactly to stdout/stderr and about exactly how the output looks.

However, I insist on keeping the deprecation warnings on them to not
tempt anyone to use them for logging/debugging out of habit and/or
laziness.

For this reason, I've added a tsfprintf function to util.c. It is
functionally identical to fprintf, except it returns void. Yes, the name
is deliberately ugly. Avoid using it if possible, but if you must, only
use it to write to stdout or stderr. Do not write to actual files with
it, use SDL_RWops.
2017-03-13 07:45:01 +02:00
Andrei "Akari" Alexeyev
9b0cbe3da1 Fixed improper usage of png_set_read_fn and png_set_write_fn 2017-03-12 23:25:19 +02:00
Andrei "Akari" Alexeyev
4b132656a5 use SDL_RWops to read png textures 2017-03-12 23:07:21 +02:00
Andrei "Akari" Alexeyev
dafec80119 use SDL_RWops for screenshots 2017-03-12 22:54:34 +02:00
Andrei "Akari" Alexeyev
dacbf96427 moved util functions from global to where they make a bit more sense 2017-03-06 03:24:47 +02:00
Andrei "Akari" Alexeyev
4a06714812 fixed wave theory with this voodoo 2017-03-05 05:20:19 +02:00
Andrei "Akari" Alexeyev
1961b3af84 abort on GL error so we can get a traceback from gdb 2017-03-05 04:30:39 +02:00
Andrei "Akari" Alexeyev
f09996d7c9 OpenGL debugging 2017-03-05 04:22:41 +02:00
Andrei "Akari" Alexeyev
3da3dd0b99 video settings fixes / improvements 2017-03-01 02:40:50 +02:00
Andrei "Akari" Alexeyev
f051a3afd9 Disable resizable window by default, added an option to enable it back
Not everyone needs a freely resizable window and it causes problems on
some systems.
2017-03-01 02:25:52 +02:00