mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Fix wrong sounds option key, fix 'fly on' being two pixels too high
This commit is contained in:
parent
bdd37b98ab
commit
869064c5c7
@ -523,20 +523,20 @@ void Window_GetClipboardText(String* value) {
|
||||
void Window_SetClipboardText(const String* value) {
|
||||
PasteboardRef pbRef;
|
||||
CFDataRef cfData;
|
||||
char str[800];
|
||||
int len;
|
||||
OSStatus err;
|
||||
|
||||
|
||||
pbRef = Window_GetPasteboard();
|
||||
|
||||
err = PasteboardClear(pbRef);
|
||||
err = PasteboardClear(pbRef);
|
||||
if (err) ErrorHandler_Fail2(err, "Clearing Pasteboard");
|
||||
PasteboardSynchronize(pbRef);
|
||||
|
||||
IntPtr ptr = Marshal.StringToHGlobalUni(value);
|
||||
cfData = CFDataCreate(NULL, ptr, (value.Length + 1) * 2);
|
||||
|
||||
len = Platform_ConvertString(str, value);
|
||||
CFDataCreate(NULL, str, len);
|
||||
if (!cfData) ErrorHandler_Fail("CFDataCreate() returned null pointer");
|
||||
|
||||
PasteboardPutItemFlavor(pbRef, 1, FMT_UTF16, cfData, 0);
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
|
||||
PasteboardPutItemFlavor(pbRef, 1, FMT_UTF8, cfData, 0);
|
||||
}
|
||||
/* TODO: IMPLEMENT void Window_SetIcon(Bitmap* bmp); */
|
||||
|
||||
|
@ -604,14 +604,8 @@ void Window_ProcessEvents(void) {
|
||||
|
||||
if (e.xselectionrequest.selection == xa_clipboard && e.xselectionrequest.target == xa_utf8_string && clipboard_copy_text.length) {
|
||||
reply.xselection.property = Window_GetSelectionProperty(&e);
|
||||
uint8_t data[1024];
|
||||
int i, len = 0;
|
||||
|
||||
for (i = 0; i < clipboard_copy_text.length; i++) {
|
||||
uint8_t* cur = data + len;
|
||||
Codepoint cp = Convert_CP437ToUnicode(clipboard_copy_text.buffer[i]);
|
||||
len += Convert_UnicodeToUtf8(cp, cur);
|
||||
}
|
||||
char str[800];
|
||||
int len = Platform_ConvertString(str, &clipboard_copy_text);
|
||||
|
||||
XChangeProperty(win_display, reply.xselection.requestor, reply.xselection.property, xa_utf8_string, 8,
|
||||
PropModeReplace, data, len);
|
||||
|
@ -13,7 +13,7 @@ extern const char* FpsLimit_Names[FPS_LIMIT_COUNT];
|
||||
#define OPT_USE_MUSIC "usemusic"
|
||||
#define OPT_USE_SOUND "usesound"
|
||||
#define OPT_MUSIC_VOLUME "musicvolume"
|
||||
#define OPT_SOUND_VOLUME "soundvolume"
|
||||
#define OPT_SOUND_VOLUME "soundsvolume"
|
||||
#define OPT_FORCE_OPENAL "forceopenal"
|
||||
#define OPT_FORCE_OLD_OPENGL "force-oldgl"
|
||||
|
||||
|
@ -362,24 +362,28 @@ static void StatusScreen_ContextLost(void* screen) {
|
||||
Elem_TryFree(&s->HackStates);
|
||||
}
|
||||
|
||||
static void StatusScreen_ContextRecreated(void* screen) {
|
||||
static void StatusScreen_ContextRecreated(void* screen) {
|
||||
static String chars = String_FromConst("0123456789-, ()");
|
||||
static String prefix = String_FromConst("Position: ");
|
||||
struct StatusScreen* s = screen;
|
||||
String chars = String_FromConst("0123456789-, ()");
|
||||
String prefix = String_FromConst("Position: ");
|
||||
|
||||
struct TextWidget* status = &s->Status;
|
||||
struct TextWidget* hacks = &s->HackStates;
|
||||
int y;
|
||||
|
||||
y = 2;
|
||||
TextWidget_Make(status);
|
||||
Widget_SetLocation(status, ANCHOR_MIN, ANCHOR_MIN, 2, 2);
|
||||
Widget_SetLocation(status, ANCHOR_MIN, ANCHOR_MIN, 2, y);
|
||||
status->ReducePadding = true;
|
||||
StatusScreen_Update(s, 1.0);
|
||||
|
||||
int elemHeight = status->Height + 2;
|
||||
y += status->Height;
|
||||
TextAtlas_Make(&s->PosAtlas, &chars, &s->Font, &prefix);
|
||||
s->PosAtlas.Tex.Y = elemHeight;
|
||||
s->PosAtlas.Tex.Y = y;
|
||||
|
||||
struct TextWidget* hacks = &s->HackStates;
|
||||
y += s->PosAtlas.Tex.Height;
|
||||
TextWidget_Make(hacks);
|
||||
Widget_SetLocation(hacks, ANCHOR_MIN, ANCHOR_MIN, 2, elemHeight * 2);
|
||||
Widget_SetLocation(hacks, ANCHOR_MIN, ANCHOR_MIN, 2, y);
|
||||
hacks->ReducePadding = true;
|
||||
StatusScreen_UpdateHackState(s);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user