Testing on real wii hardware some more
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "display/mesh/quad.h"
|
#include "display/mesh/quad.h"
|
||||||
|
|
||||||
#define SPRITEBATCH_SPRITES_MAX 32
|
#define SPRITEBATCH_SPRITES_MAX 240
|
||||||
#define SPRITEBATCH_VERTEX_COUNT (SPRITEBATCH_SPRITES_MAX * QUAD_VERTEX_COUNT)
|
#define SPRITEBATCH_VERTEX_COUNT (SPRITEBATCH_SPRITES_MAX * QUAD_VERTEX_COUNT)
|
||||||
#define SPRITEBATCH_FLUSH_COUNT 4
|
#define SPRITEBATCH_FLUSH_COUNT 4
|
||||||
#define SPRITEBATCH_SPRITES_MAX_PER_FLUSH (\
|
#define SPRITEBATCH_SPRITES_MAX_PER_FLUSH (\
|
||||||
|
|||||||
+16
-16
@@ -41,13 +41,13 @@ void onNetworkConnected(void *user) {
|
|||||||
|
|
||||||
networkinfo_t info = networkGetInfo();
|
networkinfo_t info = networkGetInfo();
|
||||||
if(info.type == NETWORK_TYPE_IPV4) {
|
if(info.type == NETWORK_TYPE_IPV4) {
|
||||||
printf(
|
sceneLog(
|
||||||
"Connected to network with IPv4 address: " NETWORK_INFO_FORMAT_IPV4 "\n",
|
"Connected to network with IPv4 address: " NETWORK_INFO_FORMAT_IPV4 "\n",
|
||||||
info.ipv4.ip[0], info.ipv4.ip[1], info.ipv4.ip[2], info.ipv4.ip[3]
|
info.ipv4.ip[0], info.ipv4.ip[1], info.ipv4.ip[2], info.ipv4.ip[3]
|
||||||
);
|
);
|
||||||
#ifdef DUSK_NETWORK_IPV6
|
#ifdef DUSK_NETWORK_IPV6
|
||||||
} else if(info.type == NETWORK_TYPE_IPV6) {
|
} else if(info.type == NETWORK_TYPE_IPV6) {
|
||||||
printf(
|
sceneLog(
|
||||||
"Connected to network with IPv6 address: " NETWORK_INFO_FORMAT_IPV6 "\n",
|
"Connected to network with IPv6 address: " NETWORK_INFO_FORMAT_IPV6 "\n",
|
||||||
info.ipv6.ip[0], info.ipv6.ip[1], info.ipv6.ip[2], info.ipv6.ip[3],
|
info.ipv6.ip[0], info.ipv6.ip[1], info.ipv6.ip[2], info.ipv6.ip[3],
|
||||||
info.ipv6.ip[4], info.ipv6.ip[5], info.ipv6.ip[6], info.ipv6.ip[7],
|
info.ipv6.ip[4], info.ipv6.ip[5], info.ipv6.ip[6], info.ipv6.ip[7],
|
||||||
@@ -57,27 +57,27 @@ void onNetworkConnected(void *user) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Network connected, I will disconnect at: %.2f1.\n", onlineSwapTime);
|
sceneLog("Network connected, I will disconnect at: %.2f1.\n", onlineSwapTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onNetworkFailed(errorret_t error, void *user) {
|
void onNetworkFailed(errorret_t error, void *user) {
|
||||||
onlineSwapTime = TIME.time + 3.0f;
|
onlineSwapTime = TIME.time + 3.0f;
|
||||||
printf("Failed to connect to network, will try again at %.2f1.\n", onlineSwapTime);
|
sceneLog("Failed to connect to network, will try again at %.2f1.\n", onlineSwapTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onNetworkDisconnected(errorret_t error, void *user) {
|
void onNetworkDisconnected(errorret_t error, void *user) {
|
||||||
onlineSwapTime = TIME.time + 3.0f;
|
onlineSwapTime = TIME.time + 3.0f;
|
||||||
printf("Network disconnected, will go online at %.2f1.\n", onlineSwapTime);
|
sceneLog("Network disconnected, will go online at %.2f1.\n", onlineSwapTime);
|
||||||
errorCatch(errorPrint(error));
|
errorCatch(errorPrint(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
void onNetworkDisconnectFinished(void *user) {
|
void onNetworkDisconnectFinished(void *user) {
|
||||||
onlineSwapTime = TIME.time + 3.0f;
|
onlineSwapTime = TIME.time + 3.0f;
|
||||||
printf("Finished disconnecting from network, will go online at %.2f1.\n", onlineSwapTime);
|
sceneLog("Finished disconnecting from network, will go online at %.2f1.\n", onlineSwapTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void goOnline() {
|
void goOnline() {
|
||||||
printf("Going online...\n");
|
sceneLog("Going online...\n");
|
||||||
networkRequestConnection(
|
networkRequestConnection(
|
||||||
onNetworkConnected,
|
onNetworkConnected,
|
||||||
onNetworkFailed,
|
onNetworkFailed,
|
||||||
@@ -87,7 +87,7 @@ void goOnline() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void goOffline() {
|
void goOffline() {
|
||||||
printf("Going offline...\n");
|
sceneLog("Going offline...\n");
|
||||||
networkRequestDisconnection(onNetworkDisconnectFinished, NULL);
|
networkRequestDisconnection(onNetworkDisconnectFinished, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ errorret_t engineInit(const int32_t argc, const char_t **argv) {
|
|||||||
errorChain(networkInit());
|
errorChain(networkInit());
|
||||||
errorChain(gameInit());
|
errorChain(gameInit());
|
||||||
|
|
||||||
// printf("Init done, going to queue online in 3 seconds...\n");
|
sceneLog("Init done, going to queue online in 3 seconds...\n");
|
||||||
// onlineSwapTime = TIME.time + 3.0f;
|
onlineSwapTime = TIME.time + 3.0f;
|
||||||
|
|
||||||
// Camera
|
// Camera
|
||||||
entityid_t cam = entityManagerAdd();
|
entityid_t cam = entityManagerAdd();
|
||||||
@@ -178,12 +178,12 @@ errorret_t engineUpdate(void) {
|
|||||||
uiUpdate();
|
uiUpdate();
|
||||||
errorChain(sceneUpdate());
|
errorChain(sceneUpdate());
|
||||||
|
|
||||||
// /* Reset the box to its start position on demand. */
|
/* Reset the box to its start position on demand. */
|
||||||
// if(inputIsDown(INPUT_ACTION_ACCEPT)) {
|
if(inputIsDown(INPUT_ACTION_ACCEPT)) {
|
||||||
// componentid_t posComp = entityGetComponent(phBoxEnt, COMPONENT_TYPE_POSITION);
|
componentid_t posComp = entityGetComponent(phBoxEnt, COMPONENT_TYPE_POSITION);
|
||||||
// entityPositionSetPosition(phBoxEnt, posComp, (vec3){ 0.0f, 4.0f, 0.0f });
|
entityPositionSetPosition(phBoxEnt, posComp, (vec3){ 0.0f, 4.0f, 0.0f });
|
||||||
// entityPhysicsSetVelocity(phBoxEnt, phBoxPhys, (vec3){ 0.0f, 0.0f, 0.0f });
|
entityPhysicsSetVelocity(phBoxEnt, phBoxPhys, (vec3){ 0.0f, 0.0f, 0.0f });
|
||||||
// }
|
}
|
||||||
|
|
||||||
/* Step physics: positions are updated directly on POSITION components. */
|
/* Step physics: positions are updated directly on POSITION components. */
|
||||||
physicsManagerUpdate();
|
physicsManagerUpdate();
|
||||||
|
|||||||
@@ -180,8 +180,9 @@ errorret_t sceneRender(void) {
|
|||||||
// errorChain(shaderSetTexture(&SHADER_UNLIT, SHADER_UNLIT_0TEXTURE, &DEFAULT_FONT_TEXTURE));
|
// errorChain(shaderSetTexture(&SHADER_UNLIT, SHADER_UNLIT_0TEXTURE, &DEFAULT_FONT_TEXTURE));
|
||||||
// errorChain(shaderSetColor(&SHADER_UNLIT, SHADER_UNLIT_COLOR, COLOR_WHITE));
|
// errorChain(shaderSetColor(&SHADER_UNLIT, SHADER_UNLIT_COLOR, COLOR_WHITE));
|
||||||
errorChain(textDraw(
|
errorChain(textDraw(
|
||||||
100, 100,
|
32, 32,
|
||||||
"Hello World",
|
// "Hello World",
|
||||||
|
SCENE_LOG,
|
||||||
COLOR_WHITE,
|
COLOR_WHITE,
|
||||||
&DEFAULT_FONT_TILESET,
|
&DEFAULT_FONT_TILESET,
|
||||||
&DEFAULT_FONT_TEXTURE
|
&DEFAULT_FONT_TEXTURE
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ errorret_t meshDrawDolphin(
|
|||||||
assertTrue(offsetof(meshvertex_t, pos) == 8, "pos offset wrong");
|
assertTrue(offsetof(meshvertex_t, pos) == 8, "pos offset wrong");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Flush vertex data to GPU. This is required before drawing with GX.
|
||||||
DCFlushRange(
|
DCFlushRange(
|
||||||
(void*)&mesh->vertices[vertexOffset],
|
(void*)&mesh->vertices[vertexOffset],
|
||||||
sizeof(meshvertex_t) * vertexCount
|
sizeof(meshvertex_t) * vertexCount
|
||||||
|
|||||||
Reference in New Issue
Block a user