reset velo -> set + fix png2c wrap
This commit is contained in:
parent
f04ba84834
commit
0f7109cb11
4
app.c
4
app.c
|
@ -52,9 +52,9 @@ void key_released(int key)
|
||||||
|
|
||||||
v2 velocity = {0, 0};
|
v2 velocity = {0, 0};
|
||||||
|
|
||||||
void reset_velocity(void)
|
void set_velocity(float x, float y)
|
||||||
{
|
{
|
||||||
velocity = (v2){0, 0};
|
velocity = (v2){x, y};
|
||||||
}
|
}
|
||||||
|
|
||||||
void rebondi(v2 *pos, int scale)
|
void rebondi(v2 *pos, int scale)
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export_sym="init go key_pressed key_released reset_velocity BUFFER width height"
|
export_sym="init go key_pressed key_released set_velocity BUFFER width height"
|
||||||
export_cmd=""
|
export_cmd=""
|
||||||
for e in $export_sym; do
|
for e in $export_sym; do
|
||||||
export_cmd="$export_cmd -Wl,--export=$e";
|
export_cmd="$export_cmd -Wl,--export=$e";
|
||||||
|
|
2
load.js
2
load.js
|
@ -17,7 +17,7 @@ window.onload = () => {
|
||||||
scale_p.innerText = "scale: " + scale;
|
scale_p.innerText = "scale: " + scale;
|
||||||
}
|
}
|
||||||
reset_but.onclick = () => {
|
reset_but.onclick = () => {
|
||||||
global_instance.exports.reset_velocity();
|
global_instance.exports.set_velocity(0, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
BIN
penger.png
BIN
penger.png
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.6 KiB |
2
png2c.c
2
png2c.c
|
@ -26,7 +26,7 @@ int main(int argc, const char *argv[])
|
||||||
for (int y = 0; y < height; y++) {
|
for (int y = 0; y < height; y++) {
|
||||||
printf(" ");
|
printf(" ");
|
||||||
for (int i = 0; i < width; i++) {
|
for (int i = 0; i < width; i++) {
|
||||||
printf("0x%08X,", data[y*height + i]);
|
printf("0x%08X,", data[y*width + i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue