Skip to content

Commit

Permalink
AGS: Move global variables into the AGSController class
Browse files Browse the repository at this point in the history
  • Loading branch information
criezy committed Oct 25, 2024
1 parent c87b989 commit 797ac68
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
19 changes: 0 additions & 19 deletions engines/ags/plugins/ags_controller/ags_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,6 @@ namespace AGS3 {
namespace Plugins {
namespace AGSController {

struct Controller : public IAGSScriptManagedObject {
public:

int Dispose(void *address, bool force) override {
return true;
}

const char *GetType() override {
return "Controller";
};

int Serialize(void *address, char *buffer, int bufsize) override {
return 0;
}
};

Controller ctrlInterface;
ConReader ctrlReader;

const char *AGSController::AGS_GetPluginName() {
return "AGSController";
}
Expand Down
19 changes: 19 additions & 0 deletions engines/ags/plugins/ags_controller/ags_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ class ConReader : public IAGSManagedObjectReader {
virtual void Unserialize(int key, const char *serializedData, int dataSize);
};

struct Controller : public IAGSScriptManagedObject {
public:

int Dispose(void *address, bool force) override {
return true;
}

const char *GetType() override {
return "Controller";
};

int Serialize(void *address, char *buffer, int bufsize) override {
return 0;
}
};

class AGSController : public PluginBase {
SCRIPT_HASH(AGSController)
protected:
Expand All @@ -58,6 +74,9 @@ class AGSController : public PluginBase {
const char *AGS_GetPluginName() override;
void AGS_EngineStartup(IAGSEngine *engine) override;
int64 AGS_EngineOnEvent(int event, NumberPtr data) override;

Controller ctrlInterface;
ConReader ctrlReader;
};

} // namespace AGSController
Expand Down

0 comments on commit 797ac68

Please sign in to comment.