1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00
Commit Graph

94 Commits

Author SHA1 Message Date
Yaroslav Tretyakov
c3ba519a6e Integrate audio related variables (#3322) 2016-04-17 14:20:26 +01:00
Yaroslav Tretyakov
90a4cafc87 Fix #3307, ride music discrepancy with original (#3319) 2016-04-16 14:09:22 +01:00
IntelOrca
89ad0cc769 store windows in openrct2 memory and increase max
Allocate a bigger window list and viewport list in OpenRCT2 static memory and move over all references from RCT2.
This also removes the 'active' viewport pointer list and instead changes everything to just enumerate the whole viewport list
2016-04-14 23:00:35 +01:00
janisozaur
e61b6ffdde Cleanups, init variables 2016-04-03 14:21:50 +01:00
Michał Janiszewski
c0caf2d222 Minor fixes 2016-02-26 11:40:07 +01:00
IntelOrca
7b97721653 cap sound volume on title screen, closes #2487 2016-02-24 23:21:36 +00:00
IntelOrca
b0887f174b split sound and music mixing correctly, closes #1270 2016-02-24 22:42:50 +00:00
IntelOrca
13921111f3 remove old RCT2 cursor code and RCT2 error location variable 2016-02-16 20:30:43 +00:00
IntelOrca
d67d6a4831 add more core classes 2016-02-03 18:23:41 +00:00
Michał Janiszewski
3bf1e0e06d Rename safe_strncpy to safe_strcpy 2016-01-18 20:49:52 +01:00
IntelOrca
cdee534eb1 use SDL2's platform defines to normalise platform guards 2016-01-14 20:12:43 +00:00
Michał Janiszewski
ac8aec63bc Skip "Default sound device" on Linux
Sound on Linux is handled by PulseAudio, which creates a sink and offers
a central place to control which sources are distributed how and where.

Applications in general are expected to only offer volume controls.

Tested with 0 A.D., SuperTuxKart and a few media players, none of which
offers selecting sink directly.

As per https://en.wikipedia.org/wiki/PulseAudio#Adoption it should
covert vast majority of uses.
2016-01-11 13:59:41 +01:00
Michał Janiszewski
e666a24c82 Merge branch 'develop' into vehicle-update
Conflicts:
	projects/openrct2.vcxproj.filters
	src/audio/mixer.cpp
	src/windows/ride.c
2015-12-22 14:57:40 +01:00
LRFLEW
d769a13206 Fixed extern and enum name usage 2015-12-16 14:48:27 -06:00
Michał Janiszewski
98e204552a countof with type safety
For reference see http://www.g-truc.net/post-0708.html and
http://lxr.free-electrons.com/source/include/linux/kernel.h#L54

This will provide a type-safe mechanism for counting elements of array.
If you try passing something which cannot be counted, compiler will
frown at you right away.
2015-12-15 00:28:58 +01:00
duncanspumpkin
c00669c942 Merge sub_6DAB4C into vehicle-update 2015-12-14 21:56:00 +00:00
Kyle Kirby
caf07c2064 Clean up the comments a litte
• Make comment heads be /**
• Make rct2 addresses be double spaced indented
• Make there be a space afte rct2: and the address
• Make single-line rct2 addresses be full block comments
• Move description of method to top of comment
2015-12-11 16:19:46 -06:00
duncanspumpkin
2661622dce Fix some of the sound bugs. Note this has diverged needs attention 2015-12-05 10:49:12 +00:00
IntelOrca
c6056cbb6c Merge branch 'pre-release-0.0.3' into develop
Conflicts:
	src/audio/audio.c
2015-11-27 22:05:40 +00:00
duncanspumpkin
5bd3b8d6af Implement util_rand due to rand having a poor range on some platforms 2015-11-20 21:40:36 +00:00
Dom Light
92a30e0a32 Add missing return documentation
[skip ci]
2015-11-18 00:20:22 +00:00
Dom Light
a07333aeaf Move memory address documentation to header file 2015-11-18 00:11:31 +00:00
Dom Light
bb62b7561a Replace some uses of play_sound_panned with play_sound_at_location 2015-11-18 00:03:15 +00:00
Dom Light
e9b7e41635 Refactor audio_sound_play_planned 2015-11-17 23:05:24 +00:00
Dom Light
bbc58830f3 Allow lines to be 128 characters 2015-11-17 20:07:39 +00:00
Dom Light
72b6a1e74b Add parens and use coordinate_3d_to_2d in audio.c 2015-11-17 20:01:30 +00:00
Dom Light
b9d48d2f9b Document audio.h 2015-11-17 01:05:22 +00:00
Dom Light
b736de003e Sanitize audio.c 2015-11-17 01:05:21 +00:00
Dom Light
3a8b25a0ee Sanitize audio.h 2015-11-17 01:05:14 +00:00
Michał Janiszewski
2b02a04114 Use C++'s std::abs instead of C's to get floats
C's abs() will only work on int values, only std::abs will get floats.
2015-11-11 08:16:36 +01:00
Michał Janiszewski
c0e2a5c7be Add get_current_rotation function and DEBUG_LEVEL macros 2015-11-02 22:58:15 +01:00
Michał Janiszewski
be32b5e5f4 Init all fields in audio classes 2015-11-02 22:58:15 +01:00
Michał Janiszewski
9284930d7e Add safe_strncpy function
safe_strncpy is similar to strncpy, but makes sure buffer is
null-terminated. Update most of project to use this updated function to
prevent illegal memory accesses.
2015-10-30 16:01:00 +01:00
Daniël Heres
fdbd08e306 Calculate correct d_left / d_right 2015-10-23 14:06:38 +02:00
Daniël Heres
831dc631c8 Optimize Mixer::EffectPanS16 2015-10-23 12:40:35 +02:00
IntelOrca
be7d3d5b54 do not do any sound / music operations when in headless mode 2015-10-20 22:15:48 +01:00
Michał Janiszewski
7d0ce00bab Strip all whitespace 2015-10-20 20:48:51 +02:00
zsilencer
cf78d76bdf make disable volume on focus lost not reset title music 2015-10-17 11:48:39 -06:00
zsilencer
6449dfd6ea fix #2076 2015-10-17 11:47:04 -06:00
zsilencer
ae6c88d1ce remove unused/redundant RCT2_GLOBALS fix #2065 and cleanup 2015-10-16 02:31:31 -06:00
zsilencer
9ac89c2b5e remove directsound and get sound working for linux native 2015-09-23 09:42:55 -06:00
Michał Janiszewski
1bd8e11c0f Make it work on Linux
Right now the project is decompiled to the point where it is feasible to
try porting it to another platform. It doesn't work 100% correctly, but
it's nearing this state.

To port it to Linux I mmapped the openrct2.exe into expected places,
disabled two offending calls (RCT2_CALLPROC_EBPSAFE(0x0040701D) and
RCT2_CALLPROC_X(0x006E7FF3…)), replaced memory management routines
with generic ones and removed all the function-pointer calls.

A basic, non-exhaustive check is included to verify that memory is
loaded correctly in place.

That last bit is probably the most intrusive one, but had to be done, as
the calling convention on Linux differs from the one on Windows. It
could possibly be emulated (just like RCT2_CALLFUNC_X) until dependency
on exe is dropped.

It is possible to completely remove calls out to original code by
commenting out contents of RCT2_CALLFUNC_X, right now this will yield
working UI, but no rendering of peeps, rides or rest of world. This can
be used as a benchmark or test platform for correctness of
implementation. The data sections will still be required for now.

Assets are expected to be in specific places, so to launch it, following
needs to satisified:
* $build/data/ has to have contents of $RCT2/Data/
* $build/data/ (same as above) has to have contents of $repo/data/
* $build/ObjData/ has to have contents of $RCT2/ObjData/
* $build/../openrct2.exe has to be $repo/openrct2.exe (as of 976ea0d)
Keep in mind you can symlink stuff and that filesystems are case
sensitive!
You can copy more of required data to possibly improve your experience.

Pretty much all of this commit will possibly have to be reverted by the
time OpenRCT2 gains independence.

Remember to build with -DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON
2015-09-23 00:04:40 +02:00
Michał Janiszewski
4ce0e3a8b2 Linux platform file
Add bulk of the platform file for linux, change the compilation target
from shared library to executable for linux, provide necessary changes
to make it compile & load the stub of a process.

Make sure functions are marked as stubs where needed, and implementation
is expected.
2015-09-20 23:19:08 +02:00
Michał Janiszewski
4df8761831 remove windows-only code
Step 1 on road towards Linux.

Remove windows-specific code, stub it out where needed and make sure we
can still compile it the way it is.

Take care of Travis' build matrix to include new build configuration.

Install new packages.
2015-09-18 16:01:38 +02:00
Gymnasiast
3ddddec21c Fix some warnings 2015-09-07 14:57:39 +02:00
IntelOrca
bea74ee261 make all file IO utf8 compatible, fixes #1847 2015-08-29 13:13:23 +01:00
IntelOrca
f0100a71a7 use windows lean and mean to reduce definition conflicts 2015-08-29 13:13:22 +01:00
Runelaenen
fb5921db6d First headless version 2015-08-19 18:07:04 +02:00
Gymnasiast
59202f97f8 Make the string for 'Default audio device' translatable, fix comment 2015-08-18 21:55:04 +02:00
Gymnasiast
99dd05176f Use a define the number of default music tracks 2015-08-16 22:26:17 +02:00