Skip to content

Commit

Permalink
- new exception class for quitting the game
Browse files Browse the repository at this point in the history
This will eventually replace the atexit mess, right now it isn't used.
  • Loading branch information
coelckers committed Sep 30, 2019
1 parent e7c388d commit 12440bb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/utility/doomerrors.h
Expand Up @@ -111,6 +111,18 @@ class CVulkanError : public CDoomError
CVulkanError(const char *message) : CDoomError(message) {}
};

class CExitEvent : public std::exception
{
int m_reason;
public:
CExitEvent(int reason) { m_reason = reason; }
char const *what() const noexcept override
{
return "The game wants to exit";
}
int Reason() const { return m_reason; }
};

void I_Error (const char *error, ...) GCCPRINTF(1,2);
void I_FatalError (const char *error, ...) GCCPRINTF(1,2);

Expand Down

0 comments on commit 12440bb

Please sign in to comment.