Commit Graph

161 Commits

Author SHA1 Message Date
Augustin Cavalier e4f18add74 Game & Print Kits: Fix GCC 11 warnings. 2021-11-17 18:45:58 -05:00
Coldfirex 2ca1376080 Mass updating of OpenBeOS text to Haiku
No functional code altered.

https://dev.haiku-os.org/ticket/17197

Change-Id: I75cc74f6be0ad968fd77c31fbe5b0f650a6fe9e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4364
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-07 10:00:35 +00:00
Máximo Castañeda 2e68fbd207 Fix wrap for AUDIO_INT
Floats don't have enough precision for all 32 bit integers. In
particular, near INT32_MAX their value is INT32_MAX + 1, which, when
converted back to int becomes INT32_MIN.

Change-Id: Ief3c1177b4f69baac13df5bac977882fea95ae01
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3511
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-30 13:35:14 +00:00
Jérôme Duval 65b3fe452a GameKit: give up default template parameter for gcc2 2020-12-08 15:46:55 +01:00
Jérôme Duval 6336b86ab8 GameKit: gcc2 build fix 2020-12-08 14:39:56 +01:00
Máximo Castañeda fb6ee7844d GameSoundBuffer: avoid buffer copy
Change-Id: Ibffe80ebe5e8205e853e09b6ebb9ba65b53d83e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3475
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Máximo Castañeda cfe72209cf U8 sound format
U8 sound has a nonzero value as its zero amplitude, so it needs to be
special-cased when mixing, applying gains and other transformations.

Change-Id: I5ad96b5f39d454bffad2449ac9f27b2ae61e2ccd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3470
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 12:33:22 +00:00
Máximo Castañeda 8e9d64f0d6 FileGameSound: fix stuck in pause when ramped
Change-Id: I346d7b93fa8507451ee46856ad6618acd6e2d609
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3469
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Máximo Castañeda 15de111dcf FileGameSound: fix buffer advance accounting
Change-Id: I15bb2b1e703cad955544a1151adc6a1277b077a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3467
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-08 04:32:56 +00:00
Máximo Castañeda 8eafd6cd04 GameKit: use more than 1 sec precision ramping
Change-Id: I015f116239fad5dd48f7f4509db503dc8f60c0d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3468
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-06 18:17:55 +00:00
Máximo Castañeda 8c78892580 BFileGameSound: don't copy garbage after track end
Check for the end of track, as the stream is repositioned on the first
frame, the start of which we were copying to the buffer if there was
space left, whether we were looping or not.

Solves #16592

Change-Id: Ic49d1776577b71a4451775876597b9c9003e1d35
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3411
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-11-24 14:02:30 +00:00
Adrien Destugues baa739985b FileGameSound: remove superfluous parentheses.
Pointed out by Axel on haiku-commits.
2019-12-11 13:24:39 +01:00
Adrien Destugues 69f814cded BFileGameSound: allow initializing from a BDataIO
There is no reason to not allow this, and it makes it possible to load
data from eg. a BResource instead of a file, which is very useful.

Remove some unused members in the class and dead code, and fix style
issues.

Change-Id: I94cbd0c13c469ea80f55028cf33dfde2de4365ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2001
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-12-09 12:00:17 +00:00
CodeforEvolution 9e54316c52 Fix the build of test_app_server on 64bit
So many Jamfiles to search through...runs also, but there
are lots of graphical glitches

Change-Id: Ibf9e64566a5b8c5742792ac9b1b0f9ccc6693c8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1753
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-09-01 03:04:52 +00:00
Adrien Destugues 759ee24c4c Game Kit: do not allocate BBuffers before initializing the Media Kit
The port pool now being created in BMediaRoster init, we must make sure
the media roster is initialized before doing anything else.

Change-Id: I5a3cc61c993e9be4078772bbf341b637d951d239
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1734
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-23 03:22:49 +00:00
Adrien Destugues 088cebb96f BFileGameSound: remove annoying printf.
Change-Id: If12c4031e7ec245a79cca51fe1304f6cc21f28e4
Reviewed-on: https://review.haiku-os.org/c/1415
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2019-04-28 07:32:42 +00:00
Augustin Cavalier 1e60bdeab6 Remove all invocations of SetSubDirSupportedPlatformsBeOSCompatible. 2019-03-30 15:19:38 -04:00
Murai Takashi 1f0635d227 Game Kit: Fix -Werror=class-memaccess
Replace memset() with media_format.Clear() to fix
-Werror=class-memaccess, pointed by gcc8.

Change-Id: I87a72ac06947e90c468deda6bf6d7bb3b5fb4003
Reviewed-on: https://review.haiku-os.org/c/1113
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-28 18:58:46 +00:00
Augustin Cavalier df4074fbed Remove a lot of unused constants.
Spotted by Clang. No functional change intended.
2018-11-24 19:21:16 -05:00
JackBurton79 6ec69f4426 Small style fixes
Change-Id: I1db785122efe70e416b4073c06148c856c5a5e8d
2018-08-23 13:55:09 +02:00
Murai Takashi b08627f310 Fix catching polymorphic type by value
Replace catching polymorphic type std::bad_alloc 'by value'
with 'by reference'.
Pointed by gcc8
2018-05-16 13:49:46 +00:00
Augustin Cavalier 44d19f4d32 GameSoundDevice: Don't use operator= on BLocker. 2016-05-13 23:16:40 -04:00
Dario Casalinuovo 6d2f2ec177 Rework nodes to call Run() only after registration
* While it should not be a big problem the
  bebook specify to do it after custom operations,
  most nodes also follow this way, this commit restore
  consistency.
2015-07-24 20:09:15 +02:00
Adrien Destugues 042bb68ed6 BGameSound: make Worms Armageddon sounds work
* When the endianness is not intialized, assume B_MEDIA_HOST_ENDIAN.
This is probably what was meant (and this is what Worms Armageddon
means).
* Move creation of the media nodes back to the initialisation instead of
StartPlaying, otherwise an extra node is created each time the sound is
played.
2014-12-11 17:17:55 +01:00
Adrien Destugues bf57c148f7 BGameSound: cleanup and several fixes
* Use a template to avoid repeating the panning code for each type
* Rearrange the initialization of BSimpleGameSound so the data is only
copied 0 or 1 times (it was copied 2 or 3 times in some cases) between
the passed buffer and the final one,
* Don't execute the panning code on streams with only 1 channel as this
makes no sense and it will read and write outside the buffers
* Abort early in GameSoundBuffer::Play if fIsPlaying is false.

Fix the crashes in Worms Armageddon. Doesn't fix the sounds being mostly
white noise.
2014-12-11 16:02:59 +01:00
Oliver Tappe 220d040227 Use libstdc++, libsupc++ and libgcc from gcc_syslibs.
* Instead of faking libstdc++.so from libstdc++.a, use libstdc++.so
  from the gcc_syslibs build feature for everything except x86_gcc2.
* Use libgcc_s.so from the gcc_syslibs build feature for everything but
  x86_gcc2 (which still carries libgcc as part of libroot.so).
* Drop filtering of libgcc objects for libroot, as that is no longer
  necessary since we're only using libgcc-as-single-object for libroot
  with x86_gcc2, where the filtered object file doesn't exist. Should
  the objects that used to be filtered cause any problems as part of
  libgcc_s.so, we can always filter them as part of the gcc build.
* Use libsupc++.so from the gcc_syslibs build feature for everything but
  x86_gcc2.
* Adjust all Jamfiles accordingly.
* Deactivate building of faked libstdc++.so for non-x86-gcc2. For
  x86_gcc2, we still build libstdc++.so from the sources in the Haiku
  source tree as part of the Haiku build .
* Put gcc_syslibs package onto the image, when needed.
2014-08-13 13:32:44 +02:00
John Scipione 37fedaf849 Style fixes to the Game Kit, focus on docs 2014-06-11 16:44:48 -04:00
Ingo Weinhold 225b638263 Support building most system libraries for secondary arch
Also adjust the HaikuImageGet[Private]SystemLibs rules to support to
return the library targets matching the current architecture.
2013-08-06 00:45:22 +02:00
Sergei Reznikov 7f4d1af49d Compilation fixes for x86_64.
Added quite a few missing components to image:

alert arp bc CortexAddOnHost

CDPlayer CharacterMap DeskCalc
Devices DiskUsage Expander LaunchBox MediaConverter NetworkStatus
PoorMan Pulse Screenshot ShowImage SoundRecorder TV Workspaces

DataTranslations Media Printers ScreenSaver

BSnow Cortex FontDemo OverlayImage Pairs

cddb_daemon midi_server power_daemon print_server print_addon_server

Canon LIPS3 Compatible Canon LIPS4 Compatible Gutenprint
PCL5 Compatible PCL6 Compatible PDF Writer PS Compatible

libgame.so libmedia.so

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
2013-01-04 18:45:22 +00:00
John Scipione ff3409e005 Return EALREADY if already in requested playback mode.
That's what the BeBook says the method is suppose to do.
2012-12-24 15:27:41 -05:00
Julian Harnath 49d7857e32 Fix BDirectWindow::GetClippingRect
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2012-11-18 16:38:03 +01:00
Adrien Destugues - PulkoMandy 93e30a47be Add a simpler test for BPushGameSound and attempt to fix the most striking mistakes in there. 2012-08-15 10:32:06 +02:00
Alexander von Gluck IV 2c3ab1bed6 kits: Fix a few missed spelling issues 2012-02-08 18:06:03 -06:00
Alexander von Gluck IV 2066acfbc5 game kit: Style and whitespace cleanup. No functional change. 2012-02-08 17:38:59 -06:00
Alexander von Gluck IV 1b6bc2675f kits: Some spelling cleanup of common mistyped words
* Little whitespace cleanup
* No functional change
2012-02-08 16:50:18 -06:00
Adrien Destugues 0cc215800b Patch from bkmx.
Fixes crashes in the game sound code when using small buffers.

Closes #5093, but there are other issues left.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 20:05:31 +00:00
Adrien Destugues d3fdcc312a Use the system mixer instead of trying to instanciate another one in the game kit. This allows to use the game kit class in an hybrid way, and closes #7351.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 19:44:46 +00:00
Adrien Destugues 0044a8c39a Apply patch by bkmx from ticket #5093 : fixes some buffer index math in
BPushGameSound so at least it doesn't crashes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 14:31:08 +00:00
Marcus Overhagen 6cb28af8fd Remove unsave usage of strncpy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-19 20:54:21 +00:00
Marcus Overhagen c80809a3ab This should fix crashes due to bad initialization. Completely untested. Might help with ticket #3241
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-19 18:14:29 +00:00
Stefano Ceccherini 1345706a9f Fix typo (CID 392)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-14 21:25:16 +00:00
Axel Dörfler b289aaf66b * A BBuffer does not know where it came from, so
BBufferConsumer::BufferReceived() cannot know whom to send the "buffer is
  late" notification (unless we only have a single input). To solve this, the
  media_header now contains extra fields that can be used to create a
  media_source object.
* Unfortunately, BBufferProducer::SendBuffer() cannot know the output either in
  case there is more than one. Hence, I deprecated the existing SendBuffer()
  call and moved it into "private" - IOW old sources using it won't compile
  anymore under Haiku.
* I introduced a new SendBuffer() variant that also gets the media_source as
  argument.
* Updated all sources (that are part of the image) to use the new variant.
* Removed some purposely commented out code in the audio mixer.
* Implemented late buffer notification, as well as late buffer handling in the
  audio mixer; this is a bit of work in progress, so the debug output is left
  in there.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-12 13:15:46 +00:00
Stefano Ceccherini c9ad965c81 removed debug printfs()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33853 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-31 16:55:24 +00:00
Axel Dörfler 9fe35223cf * BWindowScreens had no sychronization mechanism whatsoever - since the
workspace activation message was asynchronous, whether or not the
  BWindowScreen stopped drawing in time was pure luck (this also caused crashes
  with the VESA driver, as that one unmaps its frame buffer during mode switch).
  Introduced a new AS_DIRECT_SCREEN_LOCK protocol for this.
* In the long term, we should let BWindowScreen use the same mechanism as
  BDirectWindows, though.
* Removed superfluous locking in BDirectWindow::_InitData().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 12:10:59 +00:00
Axel Dörfler 2c704682c4 * Reenabled direct window mode, ie. reverted r32693.
* Fixed warnings with DEBUG enabled.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 08:39:48 +00:00
Stefano Ceccherini fb984c136f Disabled BDirectWindow window mode, for the time being (at least until
we fix it). +alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 11:08:22 +00:00
Stefano Ceccherini 97cccf16b0 Use some debug output if something fails (since it definitely fails with Chart
and GLTeapot)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-23 06:55:18 +00:00
Fredrik Modeen f1a8ae14d2 Some more code styles fixes, thanks axe
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-22 19:44:45 +00:00
Fredrik Modeen eb47b26534 Added Todo from #575 and fixed some code guidelines issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-22 13:40:24 +00:00
Axel Dörfler acc71e7c7c * The feel of a BWindowScreen should actually be kWindowScreenFeel. This makes
the Deskbar behave, and not appear in front of those. However, if auto-raise
  is turned on, the mouse cursor is shown, so it seems to get activated anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-20 09:02:55 +00:00