Skip to content

Commit 15fb838

Browse files
committed
fixed it: it was windows being a bitch
1 parent d552eae commit 15fb838

6 files changed

Lines changed: 182 additions & 177 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ else
1515
WCC = x86_64-w64-mingw32-gcc
1616
endif
1717

18-
WCXXFLAGS = -g -Wall -std=c++20 -static -ffat-lto-objects -fuse-ld=lld $(JOLTFLAGS) $(GRAPHXFLAGS)
19-
WCCFLAGS = -g -Wall -static -fuse-ld=lld
18+
WCXXFLAGS = -g -Wall -std=c++20 -static -mwindows -ffat-lto-objects $(JOLTFLAGS) $(GRAPHXFLAGS)
19+
WCCFLAGS = -g -Wall -static -mwindows
2020
WLIBS = -L src/windows_dependencies/lib/jolt-mingw-w64 -l Jolt -L src/windows_dependencies/lib/lib-mingw-w64 -l glfw3 -l gdi32
2121
WINCLUDES = -I src/include -I src/windows_dependencies/include
2222

Notes.nt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,4 +1151,10 @@ Ok, weird shit when compiling on Linux now... I gotta figure this out now.
11511151

11521152
Aight, I fixed it LMFAO. It was just some minor stuff regarding the "isType" and "isLightType" functions.
11531153

1154-
Hmm, problem: when loading a new Theatre, all the Device and Actor ids are just Device or Actor.
1154+
Hmm, problem: when loading a new Theatre, all the Device and Actor ids are just Device or Actor.
1155+
1156+
Okay, so the fucking exe only crashes if switching Theatres while using the Debug build... is it because of all the printouts?
1157+
1158+
Oh my fucking god... I've wasted three hours...
1159+
1160+
ITS THE FUCKING PRINTOUTS??!?!?!!? WHAT THE FUCK WINDOWS?!?!?!?

src/g_actors.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ void RigidBodyActor::reset_to_initial_orientation_for_testing()
361361

362362
void RigidBodyActor::takeABow()
363363
{
364-
PRINTLN("Removing Device from RigidBodyActor (" << name << "):")
365364
collider->prepForDestruction();
366-
PRINTLN("Device Removed")
367365
PhysicsActor::takeABow();
368366
}
369367

@@ -398,9 +396,7 @@ void StaticBodyActor::callToStage(Theatre *parent_theatre)
398396

399397
void StaticBodyActor::takeABow()
400398
{
401-
PRINTLN("Removing Device from StaticBodyActor (" << name << "):")
402399
collider->prepForDestruction();
403-
PRINTLN("Device Removed")
404400
PhysicsActor::takeABow();
405401
}
406402

src/g_theatres.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void Theatre::createActor(int actor_type, long uid, gSettings new_settings)
120120
PRINTDEBUG(uid)
121121
if(objects.contains(uid))
122122
{
123-
PRINTERR("Tried adding a new Actor with UID " << std::quoted(std::to_string(uid)) << " to Theatre " << std::quoted(name) << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
123+
PRINTERR("Tried adding a new Actor with UID " << std::to_string(uid) << " to Theatre " << name << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
124124
return;
125125
}
126126

@@ -150,7 +150,7 @@ void Theatre::createDevice(int device_type, long uid, gSettings new_settings)
150150
{
151151
if(devices.contains(uid))
152152
{
153-
PRINTERR("Tried adding a new Device with UID " << std::quoted(std::to_string(uid)) << " to Theatre " << std::quoted(name) << " but a Device with that UID already exists! Aborting addition of this Device! If there are problems or crashes, this may be the cause!")
153+
PRINTERR("Tried adding a new Device with UID " << std::to_string(uid) << " to Theatre " << name << " but a Device with that UID already exists! Aborting addition of this Device! If there are problems or crashes, this may be the cause!")
154154
return;
155155
}
156156

@@ -172,7 +172,7 @@ void Theatre::troupeEnter(std::vector<std::pair<Actor *, long>> new_troupe)
172172
{
173173
if(objects.contains(pair.second))
174174
{
175-
PRINTERR("Tried adding a new Actor with UID " << std::quoted(std::to_string(pair.second)) << " to Theatre " << std::quoted(name) << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
175+
PRINTERR("Tried adding a new Actor with UID " << std::to_string(pair.second) << " to Theatre " << name << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
176176
return;
177177
}
178178

@@ -201,7 +201,7 @@ void Theatre::actorEnter(Actor *new_actor, long uid, gSettings new_settings)
201201
PRINTDEBUG(new_actor->name)
202202
if(objects.contains(uid))
203203
{
204-
PRINTERR("Tried adding a new Actor with UID " << std::quoted(std::to_string(uid)) << " to Theatre " << std::quoted(name) << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
204+
PRINTERR("Tried adding a new Actor with UID " << std::to_string(uid) << " to Theatre " << name << " but an Actor with that UID already exists! Aborting addition of this Actor! If there are problems or crashes, this may be the cause!")
205205
return;
206206
}
207207

@@ -260,14 +260,14 @@ void Theatre::actorLeave(Actor *old_actor)
260260
return;
261261
}
262262

263-
PRINTERR("Request to remove an Actor by pointer failed!\n\tUID of Actor given to function: " << std::quoted(std::to_string(old_actor->getUID())))
263+
PRINTERR("Request to remove an Actor by pointer failed!\n\tUID of Actor given to function: " << std::to_string(old_actor->getUID()))
264264
}
265265

266266
void Theatre::actorLeave(long uid)
267267
{
268268
if(!objects.contains(uid))
269269
{
270-
PRINTERR("Theatre was requested to delete the Actor with UID " << std::quoted(std::to_string(uid)) << " but that UID does not exist!")
270+
PRINTERR("Theatre was requested to delete the Actor with UID " << std::to_string(uid) << " but that UID does not exist!")
271271
return;
272272
}
273273

@@ -295,14 +295,14 @@ void Theatre::actorLeave(long uid)
295295
return;
296296
}
297297

298-
PRINTERR("Request to remove an Actor with UID " << std::quoted(std::to_string(uid)) << " failed!")
298+
PRINTERR("Request to remove an Actor with UID " << std::to_string(uid) << " failed!")
299299
}
300300

301301
void Theatre::placeDevice(Device *new_device, long uid, gSettings new_settings)
302302
{
303303
if(devices.contains(uid))
304304
{
305-
PRINTERR("Tried adding a new Device with UID " << std::quoted(std::to_string(uid)) << " to Theatre " << std::quoted(name) << " but a Device with that UID already exists! Aborting addition of this Device! If there are problems or crashes, this may be the cause!")
305+
PRINTERR("Tried adding a new Device with UID " << std::to_string(uid) << " to Theatre " << name << " but a Device with that UID already exists! Aborting addition of this Device! If there are problems or crashes, this may be the cause!")
306306
return;
307307
}
308308

@@ -335,14 +335,14 @@ void Theatre::removeDevice(Device *old_device)
335335
return;
336336
}
337337

338-
PRINTERR("Request to remove a Device by pointer failed!\n\tUID of Device given to function: " << std::quoted(std::to_string(old_device->getUID())))
338+
PRINTERR("Request to remove a Device by pointer failed!\n\tUID of Device given to function: " << std::to_string(old_device->getUID()))
339339
}
340340

341341
void Theatre::removeDevice(long uid)
342342
{
343343
if(!devices.contains(uid))
344344
{
345-
PRINTERR("Theatre was requested to delete the Device with UID " << std::quoted(std::to_string(uid)) << " but that UID does not exist!")
345+
PRINTERR("Theatre was requested to delete the Device with UID " << std::to_string(uid) << " but that UID does not exist!")
346346
return;
347347
}
348348

@@ -357,15 +357,15 @@ void Theatre::removeDevice(long uid)
357357
return;
358358
}
359359

360-
PRINTERR("Request to remove a Device with UID " << std::quoted(std::to_string(uid)) << " failed!")
360+
PRINTERR("Request to remove a Device with UID " << std::to_string(uid) << " failed!")
361361
}
362362

363363
Actor *Theatre::getActor(long actor_uid)
364364
{
365365
if(objects.contains(actor_uid))
366366
return objects.at(actor_uid);
367367

368-
PRINTERR("Hey! Someone asked for an Actor with the UID " << std::quoted(std::to_string(actor_uid)) << ", but none were found! The \"getActor\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
368+
PRINTERR("Hey! Someone asked for an Actor with the UID " << std::to_string(actor_uid) << ", but none were found! The \"getActor\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
369369
return nullptr;
370370
}
371371

@@ -377,7 +377,7 @@ Actor *Theatre::getActor(std::string actor_name)
377377
return pair.second;
378378
}
379379

380-
PRINTERR("Hey! Someone asked for an Actor named " << std::quoted(actor_name) << ", but none were found! The \"getActor\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
380+
PRINTERR("Hey! Someone asked for an Actor named " << actor_name << ", but none were found! The \"getActor\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
381381
return nullptr;
382382
}
383383

@@ -386,7 +386,7 @@ Device *Theatre::getDevice(long device_uid)
386386
if(devices.contains(device_uid))
387387
return devices.at(device_uid);
388388

389-
PRINTERR("Hey! Someone asked for a Device with the UID " << std::quoted(std::to_string(device_uid)) << ", but none were found! The \"getDevice\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
389+
PRINTERR("Hey! Someone asked for a Device with the UID " << std::to_string(device_uid) << ", but none were found! The \"getDevice\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
390390
return nullptr;
391391
}
392392

@@ -396,7 +396,7 @@ Device *Theatre::getDevice(std::string device_name)
396396
if(pair.second->name.compare(device_name))
397397
return pair.second;
398398

399-
PRINTERR("Hey! Someone asked for a Device named " << std::quoted(device_name) << ", but none were found! The \"getDevice\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
399+
PRINTERR("Hey! Someone asked for a Device named " << device_name << ", but none were found! The \"getDevice\" function will now return a nullptr; if the engine crashed or something wrong is happening, this may be why!")
400400
return nullptr;
401401
}
402402

src/sanity.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ once... I think, at least. This could just be a misnomer/not how that works(?) I
66
*/
77
#ifndef GRAPHX_SANITY
88
#define GRAPHX_SANITY
9+
#ifdef WIN32
10+
#include <windows.h>
11+
#endif
912
#include <iostream>
1013

1114
#include <images.h>
@@ -25,15 +28,15 @@ once... I think, at least. This could just be a misnomer/not how that works(?) I
2528
#include <glm/ext.hpp>
2629

2730
#define PRINT_MARKER std::cout << std::endl << "[=======================================]" << std::endl;
28-
#define PRINTERR(thing) std::cerr << std::endl << "[ERROR]\t" << thing << std::endl;
29-
#define PRINTIMPORTANT(thing) for(int i = 0 ; i < 10 ; i++) { std::cout << std::endl << "[!]\t" << thing; }; std::cout << std::endl;
30-
#define PRINTNOTE(thing) std::cout << std::endl << "[NOTE]\t" << thing << std::endl;
31+
#define PRINTERR(thing) std::cerr << std::endl << "[ERROR] " << thing << std::endl;
32+
#define PRINTIMPORTANT(thing) for(int i = 0 ; i < 10 ; i++) { std::cout << std::endl << "[!] " << thing; }; std::cout << std::endl;
33+
#define PRINTNOTE(thing) std::cout << std::endl << "[NOTE] " << thing << std::endl;
3134
#ifdef GRAPHX_DEBUG
3235
#define TICK(tick) std::cout << "[TICK #" << tick << "]" << std::endl;
3336
#define PRINT(thing) std::cout << thing;
3437
#define PRINTLN(thing) std::cout << std::endl << thing << std::endl;
35-
#define PRINTDEBUG(thing) std::cout << "[DEBUG]\t" << thing << std::endl;
36-
#define JOLTDEBUG(thing) std::cout << "[JOLT]\t" << thing << std::endl;
38+
#define PRINTDEBUG(thing) std::cout << "[DEBUG] " << thing << std::endl;
39+
#define JOLTDEBUG(thing) std::cout << "[JOLT] " << thing << std::endl;
3740
#else
3841
#define TICK(tick);
3942
#define PRINT(thing);

0 commit comments

Comments
 (0)