Skip to content

Commit

Permalink
Merge branch 'portable' of https://github.com/Clownacy/CSE2
Browse files Browse the repository at this point in the history
  • Loading branch information
Clownacy committed Nov 3, 2020
2 parents 9da79b7 + 53e1951 commit aafd540
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 15 deletions.
30 changes: 24 additions & 6 deletions game_english/licence.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,27 @@ Special Thanks to...
= CSE2 =
========

Currently we don't have a licence for our code. But, considering CSE2 is
intended for modders, you can probably get away with using it for that without
any of us getting mad over it.

It might be worth crediting us, just to be safe - I (Clownacy) don't mind, but
GabrielRavier does.
MIT License

Copyright (c) 2019 Regan "cuckydev" Green
Copyright (c) 2019-2020 Clownacy
Copyright (c) 2019-2020 Gabriel Ravier
Copyright (c) 2020 Cameron Cawley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 23 additions & 5 deletions game_japanese/licence.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,27 @@ this code defaults to 'All Rights Reserved'.
= CSE2 =
========

Currently we don't have a licence for our code. But, considering CSE2 is
intended for modders, you can probably get away with using it for that without
any of us getting mad over it.
MIT License

It might be worth crediting us, just to be safe - I (Clownacy) don't mind, but
GabrielRavier does.
Copyright (c) 2019 Regan "cuckydev" Green
Copyright (c) 2019-2020 Clownacy
Copyright (c) 2019-2020 Gabriel Ravier
Copyright (c) 2020 Cameron Cawley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 6 additions & 2 deletions src/Backends/Audio/SoftwareMixer/3DS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define FRAMES_PER_BUFFER (SAMPLE_RATE / 30) // 33.333 milliseconds

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define CLAMP(a, min, max) MIN(MAX((a), (min)), (max))

static void (*parent_callback)(long *stream, size_t frames_total);

Expand Down Expand Up @@ -134,9 +136,11 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr

LightEvent_Init(&audio_thread_event, RESET_ONESHOT);

audio_thread_die = false;
s32 priority = 0x30;
svcGetThreadPriority(&priority, CUR_THREAD_HANDLE);

audio_thread = threadCreate(AudioThread, NULL, 32 * 1024, 0x18, -1, false);
audio_thread_die = false;
audio_thread = threadCreate(AudioThread, NULL, 32 * 1024, CLAMP(priority - 1, 0x18, 0x3F), -1, false);

return SAMPLE_RATE;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Backends/Rendering/SDLTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,11 @@ void RenderBackend_UploadSurface(RenderBackend_Surface *surface, const unsigned
}

const unsigned char *src_pixel = pixels;
unsigned char *buffer_pointer = buffer;

// Pre-multiply the colour channels with the alpha, so blending works correctly
for (size_t y = 0; y < height; ++y)
{
unsigned char *buffer_pointer = &buffer[y * width * 4];

for (size_t x = 0; x < width; ++x)
{
*buffer_pointer++ = (src_pixel[0] * src_pixel[3]) / 0xFF;
Expand Down

0 comments on commit aafd540

Please sign in to comment.