input system rework

This commit is contained in:
veclavtalica
2025-02-04 07:32:25 +03:00
parent 4efe80bb5a
commit 02b5ac4cc3
27 changed files with 293 additions and 786 deletions

1
docs/wiki/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
!*.html

View File

@ -5,9 +5,9 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 style="margin-bottom:0in;">1. About Townengine</h1>
<h1 style="margin-bottom:0in;">T1. About Townengine</h1>
<a href="index.html">Go back
<p><a name="introduction"></a><strong>1.1 </strong><strong>Introduction</strong>
<p><a name="introduction"></a><strong>T1.1 </strong><strong>Introduction</strong>
<blockquote>
<p>Townengine, {twn}, is an opinionated game development framework designed around ideas of simplicity, managed state,
care for old devices, portability, language agnosticism, use-case orientation, iterability and low latency.
@ -34,7 +34,7 @@
<p><b>Low latency.</b> Care is given to various incarnations of feared latency. Engine is fast to build, allowing for low commitment patches.
Startup time is profiled and optimized. Streaming is used as much as possible for asset load.
</blockquote>
<p><a name="wiki"></a><strong>1.2 </strong><strong>Wiki</strong>
<p><a name="wiki"></a><strong>T1.2 </strong><strong>Wiki</strong>
<blockquote>
<p>Purpose of this wiki is to collect information on various usages of {twn} across the genres, FAQ style.
You're welcomed to contribute to it. It's written in HTML so basic you can edit it by hand.

View File

@ -5,20 +5,27 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Townengine Wiki</h1>
<table>
<tr>
<td><strong>1.</strong> <a href="#about-townengine">About Townengnine</a></td>
<td><strong>2.</strong> <a href="#making-2dot5d-shooters">Making 2.5D Shooters</a></td>
<h1 style="margin-bottom:0in">Townengine Wiki</h1>
<a>Awesomeness</a>
<table style="padding-top:1em">
<tr><td>T1.</strong> <a href="#about-townengine">About Townengnine</a></td>
<td>G1.</strong> <a href="#making-2dot5d-shooters">Making 2.5D Shooters</a></td>
</tr>
</tbody></table>
<p><a name="about-townengine"></a><strong>1. </strong><a href="about-townengine.html"><strong>About Townengine</strong></a></p>
<blockquote>
<p style="margin:0">1.1 <a href="about-townengine.html#introduction">Introduction</a></p>
<p style="margin:0">1.2 <a href="about-townengine.html#wiki">Wiki</a></p>
<tr><td>T2.</strong> <a href="#input-system">Input System</a></td>
</tr>
</table>
<p style="margin-bottom:0"><a name="about-townengine"></a>T1. </strong><a href="about-townengine.html">About Townengine</strong></a></p>
<blockquote style="margin-top:0">
<p style="margin:0">T1.1 <a href="about-townengine.html#introduction">Introduction</a></p>
<p style="margin:0">T1.2 <a href="about-townengine.html#wiki">Wiki</a></p>
</blockquote>
<p><a name="making-2dot5d-shooters"></a><strong>2. </strong><a href="making-2dot5d-shooters.html"><strong>Making 2.5D Shooters</strong></a></p>
<blockquote>
<p style="margin-bottom:0"><a name="input-system"></a>T2. </strong><a href="input-system.html">Input System</strong></a></p>
<blockquote style="margin-top:0">
<p style="margin:0">T2.1 <a href="input-system.html#design">Design</a></p>
<p style="margin:0">T2.2 <a href="input-system.html#api">API</a></p>
</blockquote>
<p style="margin-bottom:0"><a name="making-2dot5d-shooters"></a>G1. </strong><a href="making-2dot5d-shooters.html">Making 2.5D Shooters</strong></a></p>
<blockquote style="margin-top:0">
</blockquote>
</body>
</html>

View File

@ -0,0 +1,29 @@
<!doctype html>
<html>
<head>
<title>Townengine Wiki : Input System</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 style="margin-bottom:0in;">T2. Input System</h1>
<a href="index.html">Go back
<p><a name="design"></a><strong>T2.1 </strong><strong>Design</strong>
<blockquote>
<p>One of goals is to make system that has the least variance in handling. We combine mouse inputs with keys
and don't use keycodes whatsoever. Key combinations are supported. Everything is represented with an encoded string:
<pre>[control+]+control</pre>
Any variant should be combinable, even things like mouse movement + key press.
<p>One current limitation of such design is that actions will only be reported in next frame after they
were first declared, creating delay. It's possible to fix it in the future however.
</blockquote>
<p><a name="api"></a><strong>T2.2 </strong><strong>API</strong>
<blockquote>
<p>It's rather small:<pre>
void input_action(const char *name, const char *control);
bool input_action_pressed(const char *name);
bool input_action_just_pressed(const char *name);
bool input_action_just_released(const char *name);
Vec2 input_action_position(const char *name);</pre>
</blockquote>
</body>
</html>

View File

@ -1,19 +1,13 @@
/* https://wiki.c2.com/?WikiStyle */
body { margin: 1em 2.3em 1em 1.5em; zoom: 150%; padding-bottom: 50px;}
h1 { font-size: 2.1em;
font-weight: bold;
}
p { margin-left: 0.2em;
}
blockquote {
font-style: normal;
}
body { margin: 1em 2.3em 1em 1.5em; zoom: 150%; padding-bottom: 1em; }
h1 { font-size: 2.1em;
font-weight: bold; }
p { margin-left: 0.2em; text-indent: 1em hanging; }
blockquote { font-style: normal; }
pre { margin: 0em 3em 0em 2em;
color: rgb(20%,20%,50%); background-color: rgb(100%,100%,100%);
border: 1px solid rgb(50%,50%,50%);
padding: 1em;
font-size: 0.85em;
white-space: pre;
}
hr { color: rgb(30%,30%,60%);
}
color: rgb(20%,20%,50%); background-color: rgb(100%,100%,100%);
border: 1px solid rgb(50%,50%,50%);
padding: 1em;
margin-bottom: 2em;
white-space: pre; }
hr { color: rgb(30%,30%,60%); }

View File

@ -5,9 +5,9 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 style="margin-bottom:0in;">1. {About}</h1>
<h1 style="margin-bottom:0in;">X1. {About}</h1>
<a href="index.html">Go back
<p><a name="{Section}"></a><strong>1.1 </strong><strong>{Section}</strong>
<p><a name="{Section}"></a><strong>X1.1 </strong><strong>{Section}</strong>
<blockquote>
<p>Text
</blockquote>