OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Macros | Functions
Script.cpp File Reference

Tomb Raider Script Loader Unit Test. More...

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <zlib.h>
#include "global.h"
#include "Script.h"
#include "ScriptTest.h"
Include dependency graph for Script.cpp:

Go to the source code of this file.

Macros

#define printStrings(cnt, acc, name)
 
#define printStrings2D(c, cnt, acc, name)
 
#define registerLambda(x, y)
 

Functions

static int printDataScript (Script &s, bool strings)
 
static int test (const char *file, unsigned int n)
 
static int readPayloadChunk (const unsigned char *data, unsigned int size, const char *file)
 
static int runForPayload (unsigned int n, bool print, bool printData)
 
int main (int argc, char *argv[])
 

Detailed Description

Tomb Raider Script Loader Unit Test.

Author
xythobuz

Definition in file Script.cpp.

Macro Definition Documentation

#define printStrings (   cnt,
  acc,
  name 
)
Value:
{ \
std::cout << name << " (" << cnt << ")" << std::endl; \
for (unsigned int i = 0; i < cnt; i++) { \
std::cout << " " << acc(i) << std::endl; \
} \
std::cout << std::endl; \
}

Definition at line 17 of file Script.cpp.

#define printStrings2D (   c,
  cnt,
  acc,
  name 
)
Value:
{ \
std::cout << name << " (" << c << "*" << cnt << ")" << std::endl; \
for (unsigned int a = 0; a < cnt; a++) { \
std::cout << " "; \
for (unsigned int i = 0; i < c; i++) { \
std::cout << acc(i, a); \
if (i < (c - 1)) \
std::cout << " | "; \
} \
std::cout << std::endl; \
} \
std::cout << std::endl; \
}

Definition at line 25 of file Script.cpp.

#define registerLambda (   x,
 
)
Value:
{ \
s.registerScriptHandler(x, [](bool hasOperand, uint16_t operand) { \
std::cout << "\t" << y; \
if (hasOperand) \
std::cout << " (" << operand << ")"; \
std::cout << std::endl; \
return 0; \
}); \
}

Definition at line 39 of file Script.cpp.

Function Documentation

static int printDataScript ( Script s,
bool  strings 
)
static

Definition at line 49 of file Script.cpp.

static int test ( const char *  file,
unsigned int  n 
)
static

Definition at line 105 of file Script.cpp.

static int readPayloadChunk ( const unsigned char *  data,
unsigned int  size,
const char *  file 
)
static

Definition at line 131 of file Script.cpp.

static int runForPayload ( unsigned int  n,
bool  print,
bool  printData 
)
static

Definition at line 165 of file Script.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 195 of file Script.cpp.