Commit graph

52 commits

Author SHA1 Message Date
Andrei Alexeyev
f8be292802
make my windows cross-compiler (gcc 7.2 from mxe) shut the fuck up 2017-11-24 16:23:24 +02:00
Andrei Alexeyev
db8dd8ad7c
desperate optimizations
i even used a profiler
2017-11-23 18:23:30 +02:00
Andrei Alexeyev
76ee80b6da
(attempt to) prevent draw code from altering state 2017-11-16 22:25:03 +02:00
Martin Herkt
119535eda4
Fix symbol clashes
Happens to remove some duplicate code as well.
2017-11-12 04:51:04 +01:00
Andrei Alexeyev
499259512b
fix fullscreen/window management issues 2017-11-11 20:47:32 +02:00
Andrei Alexeyev
fa69e96643
make sure strtok_r doesn't clash with the system version 2017-11-10 22:26:09 +02:00
Andrei Alexeyev
62c34e3b5a
WIP fucking badass Marisa lasers 2017-10-31 08:57:32 +02:00
Andrei Alexeyev
05478cd543
another desperate attempt at an accurate fps limiter 2017-10-04 08:07:04 +03:00
Andrei Alexeyev
4e2e050baa
basic utf8 text input, with clipboard support 2017-10-01 00:43:22 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
laochailan
4eec55223a fps counter cleanup 2017-09-20 16:42:36 +02:00
Andrei "Akari" Alexeyev
35a933426a
remove remains of dead code, revert fps to 1 update/second 2017-09-19 17:36:17 +03:00
Andrei "Akari" Alexeyev
0647566e20
add env variable: TAISEI_NOUNLOAD
if 1, all resources are loaded in permanent mode
2017-09-13 08:52:55 +03:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
9b6f51ca67
WIP ricci sign overhaul 2017-09-11 04:46:39 +03:00
Andrei "Akari" Alexeyev
5dd2d70bec
Merge branch 'master' into vfs 2017-05-07 02:03:17 +03:00
Andrei "Akari" Alexeyev
c76e16ef70
Add some potentially useful warnings 2017-05-07 02:02:56 +03:00
Andrei "Akari" Alexeyev
7546b706f5 win32 implementation of vfs_syspath. tested on wine 2017-04-21 07:22:43 +03:00
Andrei "Akari" Alexeyev
12147f4486 Merge branch 'master' into vfs 2017-04-21 02:27:05 +03:00
Andrei "Akari" Alexeyev
e3da5f27f6 more correct and portable printing of size_t and fixed-width integers
previously it didn't work properly on windows
2017-04-21 02:11:53 +03:00
Andrei "Akari" Alexeyev
471f30083e WIP virtual filesystem 2017-04-20 05:02:22 +03:00
Andrei "Akari" Alexeyev
edf584b9f3 WIP rendering quality (resolution) settings.
Rewrote a lot of the stage drawing and FBO handling code. Introduced
some WTFs, hence the WIP.
2017-04-07 12:59:23 +03:00
laochailan
1e16b9bc0b Merge branch 'master' of github.com:laochailan/taisei into extraspells 2017-03-29 08:58:51 +02:00
Andrei "Akari" Alexeyev
d24234e6d5 hashtables: dynamic size and a faster hash function for string keys 2017-03-29 01:11:39 +03:00
Andrei "Akari" Alexeyev
d1bce76123 use SDL's hires timer to limit the FPS
it's a little more accurate at least on my system
2017-03-27 23:46:39 +03:00
Andrei "Akari" Alexeyev
d64a24da51 Merge branch 'master' into extraspells 2017-03-25 03:41:55 +02:00
Andrei "Akari" Alexeyev
8e8abf1db6 Fixed a buffer overflow and prohibited sprintf 2017-03-25 03:41:10 +02:00
Andrei "Akari" Alexeyev
56647ce6ba Merge branch 'master' into extraspells 2017-03-25 03:13:44 +02:00
Andrei "Akari" Alexeyev
4288e3d8df Merge branch 'master' into async 2017-03-25 00:28:45 +02:00
Andrei "Akari" Alexeyev
cc147d2aca Merge branch 'master' into extraspells 2017-03-25 00:27:25 +02:00
Andrei "Akari" Alexeyev
d8ac035f29 Record fps stats in replays. Display the player's name and fps when watching 2017-03-21 04:28:35 +02:00
Andrei "Akari" Alexeyev
96a0b5d583 Merge branch 'master' into extraspells 2017-03-20 08:18:59 +02:00
Andrei "Akari" Alexeyev
5d1eb2bd68 moved the MKDIR macro to util.h 2017-03-20 07:35:59 +02:00
Andrei "Akari" Alexeyev
a1a8ea6a61 Merge branch 'master' into extraspells 2017-03-16 10:04:05 +02:00
Andrei "Akari" Alexeyev
8fdf8d1fc7 Merge branch 'master' into async 2017-03-15 12:07:29 +02:00
Andrei "Akari" Alexeyev
455039edb4 Implemented a custom assert() that uses the log system if possible
Bonus: no need to include assert.h
2017-03-15 11:21:39 +02:00
Andrei "Akari" Alexeyev
df90733c8f WIP async loading 2017-03-14 02:46:06 +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
1ac4ff95c4 use SDL_RWops to write the config 2017-03-12 23:40:19 +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
d39ab84742 use SDL_RWops to read obj models 2017-03-12 23:23: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
ecd4fc32ad Deprecate the use of fopen for unicode reasons
Also removed the strncat/strncpy macros and marked them deprecated with
attributes instead.
2017-03-12 22:26:10 +02:00
Andrei "Akari" Alexeyev
7c67159c90 hashtable size parameter for the non-cb parse_keyvalue* functions 2017-03-11 23:47:42 +02:00
Andrei "Akari" Alexeyev
cceb1aa20d Converted the config parser into reusable utility functions 2017-03-11 23:10:05 +02:00
Andrei "Akari" Alexeyev
86930cfdc0 Merge branch 'master' into extraspells 2017-03-11 03:49:09 +02:00
Andrei "Akari" Alexeyev
22314f9582 converted SIGN into a function 2017-03-06 17:32:51 +02:00
Andrei "Akari" Alexeyev
80f2c00434 simplified resource path handling
chdir into the resources directory on startup
2017-03-06 15:07:51 +02:00
Andrei "Akari" Alexeyev
b81641a71c fix the fallback __attribute__ define 2017-03-06 10:12:12 +02:00