This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DPI_ENUMS_DECLARED | |
typedef enum PROCESS_DPI_AWARENESS { | |
PROCESS_DPI_UNAWARE = 0, | |
PROCESS_SYSTEM_DPI_AWARE = 1, | |
PROCESS_PER_MONITOR_DPI_AWARE = 2 | |
} PROCESS_DPI_AWARENESS; | |
#ifndef _DPI_AWARENESS_CONTEXTS_ | |
typedef enum DPI_AWARENESS_CONTEXT { | |
DPI_AWARENESS_INVALID, | |
DPI_AWARENESS_UNAWARE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assert(loadfile("common.inc"))(); | |
askText = singleLine([[ | |
Choose window | |
]]); | |
function sws(delay, msg) | |
sleepWithStatus(delay, msg, 0xFFFFFFff); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
let w = 128; | |
let num_images = 3; | |
let source_canvas = document.createElement('canvas'); | |
source_canvas.width = w; | |
source_canvas.height = w * num_images * 2; | |
let source_img = new Image(); | |
source_img.src = source_canvas.toDataURL('image/png'); | |
source_img.onload = function () { | |
let canvas = document.createElement('canvas'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as assert from 'assert'; | |
import { FSAPI, fileBaseName } from 'glov/common/fsapi'; | |
import { DataObject } from 'glov/common/types'; | |
type WallDesc = { | |
id: string; // filled in at load | |
other_id?: string; // from data | |
other_desc?: WallDesc; // reference at load-time | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The setup: I have an Entity class hierarchy for server/common/client, and each entity has | |
// a reference to an entity_manager, which should be templated to the appropriate type so | |
// that an entity getting other entities from the manager always get the correct type of | |
// entity back. | |
// The common code: | |
interface EntityManager<Entity extends EntityCommon = EntityCommon> { | |
entities: Partial<Record<number, Entity>>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Conceptual/Code-time hierarchy: | |
* | |
* Sever Code Common Code Client Code | |
* | |
* | |
* EntityGameServer EntityGameClient | |
* Game Code | \ / | | |
* | EntityGameCommon | | |
* | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Path to directory, or file, but not to a "." (e.g. c:/foo/.) | |
void exploreTo(const char *localfname) { | |
wchar_t *path = utf8ToWideAlloc(localfname); | |
for (wchar_t *s = path; *s; ++s) | |
if (*s == '/') | |
*s = '\\'; | |
// Remove trailing backslash, FindFirst will fail | |
if (path[wcslen(path) - 1] == '\\') { | |
path[wcslen(path) - 1] = '\0'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dofile("common.inc"); | |
dofile("screen_reader_common.inc"); | |
dofile("ui_utils.inc"); | |
local styles = { | |
WS_BORDER=0x00800000, | |
WS_DLGFRAME=0x00400000, | |
-- WS_CAPTION=0x00C00000, WS_BORDER | WS_DLGFRAME | |
-- WS_CHILD=0x40000000, not relevant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var _window$foo = window.foo, | |
a = _window$foo[0], | |
b = _window$foo[1]; | |
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluLmpzIl0sIm5hbWVzIjpbIndpbmRvdyIsImZvbyIsImEiLCJiIl0sIm1hcHBpbmdzIjoiOztrQkFBYUEsTUFBTSxDQUFDQyxHO0lBQWZDLEM7SUFBR0MsQyIsImZpbGUiOiJpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBbYSwgYl0gPSB3aW5kb3cuZm9vO1xuIl19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { round, floor, ceil } = Math; | |
let correct = [0,0,0]; | |
function test(dpr, dim) { | |
let clientWidth = round(dim / dpr); | |
let scaled = clientWidth * dpr; | |
if (round(scaled) === dim) { | |
correct[0]++; | |
} | |
if (floor(scaled) === dim) { | |
correct[1]++; |
NewerOlder