answer
stringlengths 15
1.25M
|
|---|
#include <QtGui>
#include <QTcpSocket>
#include "phonecall.h"
#include "dcc.h"
DCCDialog::DCCDialog(QWidget *parent)
: QDialog(parent)
{
QStringList list;
QVBoxLayout* mainLayout = new QVBoxLayout(this);
table = new QTableWidget(this);
table->setColumnCount(8);
list << tr("Status") << tr("File") << tr("Size") << tr("Position") << "%" << "KB/s" << "ETA" << tr("Nick");
table-><API key>(list);
mainLayout->addWidget(table);
closeButton = new QPushButton(tr("Save and Close"));
connect(closeButton, SIGNAL(clicked()), this, SLOT(saveAndClose()));
mainLayout->addWidget(closeButton);
setLayout(mainLayout);
setWindowTitle(tr("File Transfers"));
call = 0;
}
DCCDialog::~DCCDialog()
{
}
void DCCDialog::command(const QString &cmd)
{
//user:ip:DCC SEND <filename> <ip> <port> <filesize>
//user:ip:DCC CHAT accept <ip> <audio port> <video port>
//user:ip:DCC CHAT call <ip> <audio port> <video port>
//qWarning()<<"cmd: "<<cmd;
QStringList list = cmd.split(':');
QString user = list.at(0);
QString ip = list.at(1);
QStringList params = cmd.split(' ');
//qWarning()<<"params "<<params;
//qWarning()<<"list "<<list;
if(params.size() < 6) return;
if(params.at(1).contains("SEND")) {
QMessageBox msgBox;
QString text = QString("%1 wants to send you a file called %2").arg(user).arg(params.at(2));
msgBox.setText(text);
msgBox.setInformativeText("Do you want to accept the file transfer?");
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Cancel);
int ret = msgBox.exec();
if(ret == QMessageBox::Save) {
QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);
dialog.selectFile(params.at(2));
if(dialog.exec()) {
QStringList files = dialog.selectedFiles();
//qWarning()<<"destination = "<<files.at(0);
TransferData* data = new TransferData;
data->user = user;
data->status = "Waiting";
data->file = params.at(2);
data->destination = new QFile(files.at(0));
data->size = params.at(5).toInt();
data->position = 0;
data->complete = 0;
data->rate = 0;
data->eta = -1;
data->comms = new QTcpSocket;
int currentRow = table->rowCount();
//qWarning()<<"currentRow="<<currentRow;
table->insertRow(currentRow);
table->setItem(currentRow, 0, new QTableWidgetItem(data->status));
table->setItem(currentRow, 1, new QTableWidgetItem(data->file));
table->setItem(currentRow, 2, new QTableWidgetItem(QString("%1kB").arg(data->size/1024)));
table->setItem(currentRow, 3, new QTableWidgetItem(QString("%1").arg(data->position)));
table->setItem(currentRow, 4, new QTableWidgetItem(QString("%1\%").arg(data->complete)));
table->setItem(currentRow, 5, new QTableWidgetItem(QString("%1Kb/s").arg(data->rate)));
table->setItem(currentRow, 6, new QTableWidgetItem(QString("%1min").arg(data->eta)));
table->setItem(currentRow, 7, new QTableWidgetItem(data->user));
connect(data->comms,SIGNAL(connected()),this,SLOT(startTransfer()));
connect(data->comms,SIGNAL(readyRead()),this,SLOT(processReadyRead()));
transfers.append(data);
table-><API key>();
if(table->selectedItems().isEmpty()) {
table->selectRow(0);
// start transfer...
}
}
}
show();
} else if(params.at(1).contains("CHAT")) {
//qWarning()<<"got a CHAT message";
if(params.at(2).contains("call")) {
//qWarning()<<"got a CHAT call";
// someone has requested a call
QMessageBox msgBox;
QString text = QString("%1 wants to talk").arg(user);
msgBox.setText(text);
msgBox.setInformativeText("Do you want to accept the call?");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Cancel);
int ret = msgBox.exec();
if(ret == QMessageBox::Ok) {
// send accept message and setup for incoming.
QString msg = QString("PRIVMSG %1 :\001DCC CHAT accept %2 %3 %4\001\r\n").arg(user).arg(ip).arg(AUDIO_PORT).arg(0);
PhoneCallDialog* incoming = new PhoneCallDialog(this,user,ip,false);
incoming->show();
emit ircMsg(msg);
}
} else if(params.at(2).contains("accept")) {
//qWarning()<<"got a CHAT accept";
// your request has been accepted, connect to other end.
//qWarning()<<"I should be able to connect to "<<ip<<QString(" on port %1").arg(AUDIO_PORT);
if(call) delete call;
call = new PhoneCallDialog(this,user,ip,true);
call->show();
call->connectToHost();
}
}
}
void DCCDialog::startTransfer()
{
//qWarning()<<"TODO:startTransfer()";
}
void DCCDialog::processReadyRead()
{
//qWarning()<<"TODO:processReadyRead()";
}
void DCCDialog::saveAndClose()
{
close();
}
|
package cn.com.jautoitx;
import org.apache.commons.lang3.StringUtils;
import com.sun.jna.platform.win32.WinDef.HWND;
/**
* Build window title base on Advanced Window Descriptions.
*
* @author zhengbo.wang
*/
public class TitleBuilder {
/**
* Build window title base on Advanced Window Descriptions.
*
* @param bys
* Selectors to build advanced window title.
* @return Returns advanced window title.
*/
public static String by(By... bys) {
StringBuilder title = new StringBuilder();
title.append('[');
String separator = "";
for (int i = 0; i < bys.length; i++) {
title.append(separator);
String strBy = bys[i].toAdvancedTitle();
if (!strBy.isEmpty()) {
title.append(strBy);
separator = "; ";
}
}
title.append(']');
return title.toString();
}
/**
* Build window title base on window title.
*
* @param title
* Window title.
* @return Returns advanced window title.
*/
public static String byTitle(String title) {
return by(By.title(title));
}
/**
* Build window title base on the internal window classname.
*
* @param className
* The internal window classname.
* @return Returns advanced window title.
*/
public static String byClassName(String className) {
return by(By.className(className));
}
/**
* Build window title base on window title using a regular expression.
*
* @param regexpTitle
* Window title using a regular expression.
* @return Returns advanced window title.
*/
public static String byRegexpTitle(String regexpTitle) {
return by(By.regexpTitle(regexpTitle));
}
/**
* Build window title base on window classname using a regular expression.
*
* @param regexpClassName
* Window classname using a regular expression.
* @return Returns advanced window title.
*/
public static String byRegexpClassName(String regexpClassName) {
return by(By.regexpClassName(regexpClassName));
}
/**
* Build window title base on window used in a previous AutoIt command.
*
* @return Returns advanced window title.
*/
public static String byLastWindow() {
return by(By.lastWindow());
}
/**
* Build window title base on currently active window.
*
* @return Returns advanced window title.
*/
public static String byActiveWindow() {
return by(By.activeWindow());
}
/**
* Build window title base on the position and size of a window. All
* parameters are optional.
*
* @param x
* Optional, the X coordinate of the window.
* @param y
* Optional, the Y coordinate of the window.
* @param width
* Optional, the width of the window.
* @param height
* Optional, the height of the window.
* @return Returns advanced window title.
*/
public static String byBounds(Integer x, Integer y, Integer width,
Integer height) {
return by(By.bounds(x, y, width, height));
}
/**
* Build window title base on the position of a window. All parameters are
* optional.
*
* @param x
* Optional, the X coordinate of the window.
* @param y
* Optional, the Y coordinate of the window.
* @return Returns advanced window title.
*/
public static String byPosition(Integer x, Integer y) {
return by(By.position(x, y));
}
/**
* Build window title base on the size of a window. All parameters are
* optional.
*
* @param width
* Optional, the width of the window.
* @param height
* Optional, the height of the window.
* @return Returns advanced window title.
*/
public static String bySize(Integer width, Integer height) {
return by(By.size(width, height));
}
/**
* Build window title base on the 1-based instance when all given properties
* match.
*
* @param instance
* The 1-based instance when all given properties match.
* @return Returns advanced window title.
*/
public static String byInstance(int instance) {
return by(By.instance(instance));
}
/**
* Build window title base on the handle address as returned by a method
* like Win.getHandle.
*
* @param handle
* The handle address as returned by a method like Win.getHandle.
* @return Returns advanced window title.
*/
public static String byHandle(String handle) {
return by(By.handle(handle));
}
/**
* Build window title base on the handle address as returned by a method
* like Win.getHandle_.
*
* @param hWnd
* The handle address as returned by a method like
* Win.getHandle_.
* @return Returns advanced window title.
*/
public static String byHandle(HWND hWnd) {
return by(By.handle(hWnd));
}
/**
* Selector to build advanced window title.
*
* @author zhengbo.wang
*/
public static abstract class By {
private final String property;
private final String value;
public By(final String property) {
this.property = property;
this.value = null;
}
public By(final String property, final String value) {
this.property = property;
this.value = StringUtils.defaultString(value);
}
/**
* @param title
* Window title.
* @return a By which locates window by the window title.
*/
public static By title(String title) {
return new ByTitle(title);
}
/**
* @param className
* The internal window classname.
* @return a By which locates window by the internal window classname.
*/
public static By className(String className) {
return new ByClass(className);
}
/**
* @param regexpTitle
* Window title using a regular expression.
* @return a By which locates window by the window title using a regular
* expression.
*/
public static By regexpTitle(String regexpTitle) {
return new ByRegexpTitle(regexpTitle);
}
/**
* @param regexpClassName
* Window classname using a regular expression.
* @return a By which locates window by the window classname using a
* regular expression.
*/
public static By regexpClassName(String regexpClassName) {
return new ByRegexpClass(regexpClassName);
}
/**
* @return a By which locates window used in a previous AutoIt command.
*/
public static By lastWindow() {
return new ByLast();
}
/**
* @return a By which locates currently active window.
*/
public static By activeWindow() {
return new ByActive();
}
/**
* All parameters are optional.
*
* @param x
* Optional, the X coordinate of the window.
* @param y
* Optional, the Y coordinate of the window.
* @param width
* Optional, the width of the window.
* @param height
* Optional, the height of the window.
* @return a By which locates window by the position and size of a
* window.
*/
public static By bounds(Integer x, Integer y, Integer width,
Integer height) {
return new ByBounds(x, y, width, height);
}
/**
* All parameters are optional.
*
* @param x
* Optional, the X coordinate of the window.
* @param y
* Optional, the Y coordinate of the window.
* @return a By which locates window by the position of a window.
*/
public static By position(Integer x, Integer y) {
return bounds(x, y, null, null);
}
/**
* All parameters are optional.
*
* @param width
* Optional, the width of the window.
* @param height
* Optional, the height of the window.
* @return a By which locates window by the size of a window.
*/
public static By size(Integer width, Integer height) {
return bounds(null, null, width, height);
}
/**
* @param instance
* The 1-based instance when all given properties match.
* @return a By which locates window by the instance when all given
* properties match.
*/
public static By instance(int instance) {
return new ByInstance(instance);
}
/**
* @param handle
* The handle address as returned by a method like
* Win.getHandle.
* @return a By which locates window by the handle address as returned
* by a method like Win.getHandle.
*/
public static By handle(String handle) {
return new ByHandle(handle);
}
/**
* @param hWnd
* The handle address as returned by a method like
* Win.getHandle_.
* @return a By which locates window by the handle address as returned
* by a method like Win.getHandle.
*/
public static By handle(HWND hWnd) {
return new ByHandle(hWnd);
}
public String toAdvancedTitle() {
StringBuilder advancedTitle = new StringBuilder();
advancedTitle.append(property);
if (value != null) {
advancedTitle.append(':');
for (int i = 0; i < value.length(); i++) {
char ch = value.charAt(i);
advancedTitle.append(ch);
// Note: if a Value must contain a ";" it must be doubled.
if (ch == ';') {
advancedTitle.append(';');
}
}
}
return advancedTitle.toString();
}
@Override
public String toString() {
return "By." + property + ": " + value;
}
}
/**
* Window title.
*
* @author zhengbo.wang
*/
public static class ByTitle extends By {
public ByTitle(String title) {
super("TITLE", title);
}
}
/**
* The internal window classname.
*
* @author zhengbo.wang
*/
public static class ByClass extends By {
public ByClass(String clazz) {
super("CLASS", clazz);
}
}
/**
* Window title using a regular expression.
*
* @author zhengbo.wang
*/
public static class ByRegexpTitle extends By {
public ByRegexpTitle(String clazz) {
super("REGEXPTITLE", clazz);
}
}
/**
* Window classname using a regular expression.
*
* @author zhengbo.wang
*/
public static class ByRegexpClass extends By {
public ByRegexpClass(String regexpClass) {
super("REGEXPCLASS", regexpClass);
}
}
/**
* Last window used in a previous AutoIt command.
*
* @author zhengbo.wang
*/
public static class ByLast extends By {
public ByLast() {
super("LAST");
}
}
/**
* Currently active window.
*
* @author zhengbo.wang
*/
public static class ByActive extends By {
public ByActive() {
super("ACTIVE");
}
}
/**
* The position and size of a window.
*
* @author zhengbo.wang
*/
public static class ByBounds extends By {
private final Integer x;
private final Integer y;
private final Integer width;
private final Integer height;
public ByBounds(Integer x, Integer y, Integer width, Integer height) {
super("POSITION AND SIZE", String.format("%s \\ %s \\ %s \\ %s",
String.valueOf(x), String.valueOf(y),
String.valueOf(width), String.valueOf(height)));
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
@Override
public String toAdvancedTitle() {
StringBuilder advancedTitle = new StringBuilder();
if (x != null) {
advancedTitle.append("X:").append(x);
}
if (y != null) {
if (!advancedTitle.toString().isEmpty()) {
advancedTitle.append("\\");
}
advancedTitle.append("Y:").append(y);
}
if (width != null) {
if (!advancedTitle.toString().isEmpty()) {
advancedTitle.append("\\");
}
advancedTitle.append("W:").append(width);
}
if (height != null) {
if (!advancedTitle.toString().isEmpty()) {
advancedTitle.append("\\");
}
advancedTitle.append("H:").append(height);
}
return advancedTitle.toString();
}
}
/**
* The 1-based instance when all given properties match.
*
* @author zhengbo.wang
*/
public static class ByInstance extends By {
public ByInstance(int instance) {
super("INSTANCE", String.valueOf(instance));
}
}
/**
* The handle address as returned by a method like Win.getHandle or
* Win.getHandle_.
*
* @author zhengbo.wang
*/
public static class ByHandle extends By {
public ByHandle(String handle) {
super("HANDLE", handle);
}
public ByHandle(HWND hWnd) {
this(AutoItX.hwndToHandle(hWnd));
}
}
}
|
\begin{lstlisting}[caption=RoR installation]
# install ruby
sudo apt-get install ruby ruby-dev
# install sqllite
sudo apt-get install sqlite3 libsqlite3-dev
# install postgresql
sudo apt-get install postgresql
# install java script
sudo apt-get install nodejs
# download and cd to gems directory
sudo ruby setup.rb
#gem update --system
# optional
sudo gem install execjs
sudo gem install jquery-rails
sudo gem install multi_json
sudo gem install jquery-turbolinks
sudo gem install sprockets
sudo gem install sprockets
sudo gem install rails
sudo gem install activemodel
sudo gem install actionmailer
sudo gem install coffee-rails
sudo gem install coffee-script
sudo gem install json_pure
sudo gem install <API key>
sudo gem install arel
sudo gem install sqlite3
\end{lstlisting}
|
package me.vadik.instaclimb.view.adapter;
import android.content.Context;
import android.databinding.ViewDataBinding;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import me.vadik.instaclimb.databinding.<API key>;
import me.vadik.instaclimb.databinding.UserCardBinding;
import me.vadik.instaclimb.model.Route;
import me.vadik.instaclimb.model.User;
import me.vadik.instaclimb.view.adapter.abstr.<API key>;
import me.vadik.instaclimb.viewmodel.RouteItemViewModel;
import me.vadik.instaclimb.viewmodel.UserViewModel;
public class <API key> extends <API key><User, Route> {
public <API key>(Context context, User user) {
super(context, user);
}
@Override
protected ViewDataBinding onCreateHeader(LayoutInflater inflater, ViewGroup parent) {
return UserCardBinding.inflate(inflater, parent, false);
}
@Override
protected ViewDataBinding onCreateItem(LayoutInflater inflater, ViewGroup parent) {
return <API key>.inflate(inflater, parent, false);
}
@Override
protected void onBindHeader(ViewDataBinding binding, User user) {
((UserCardBinding) binding).setUser(new UserViewModel(mContext, user));
}
@Override
protected void onBindItem(ViewDataBinding binding, Route route) {
((<API key>) binding).setRoute(new RouteItemViewModel(mContext, route));
}
}
|
Ext.define('Omni.view.sizes.Explorer', {
extend: 'Buildit.ux.explorer.Panel',
alias: 'widget.omni-sizes-Explorer',
initComponent: function() {
var me = this;
Ext.apply(this, {
allowFind: true,
store: Ext.create('Omni.store.Size'),
contextMenuConfig: {
xtype: '<API key>'
},
newForms: [{
xtype: 'omni-sizes-Form',
windowConfig: {}
}],
inspectorConfig: {
xtype: '<API key>'
}
});
// EXPLORER INIT (End)
Ext.applyIf(this, {
size_nbrLabel: Omni.i18n.model.Size.size_nbr,
size_typeLabel: Omni.i18n.model.Size.size_type,
displayLabel: Omni.i18n.model.Size.display,
<API key>: Omni.i18n.model.Size.concatenated_name,
dimension_1Label: Omni.i18n.model.Size.dimension_1,
dimension_2Label: Omni.i18n.model.Size.dimension_2,
is_enabledLabel: Omni.i18n.model.Size.is_enabled
});
// LABELS (End)
Ext.apply(this, {
columns: [{
header: this.displayLabel,
dataIndex: 'display',
flex: 1,
sortable: false
}, {
header: this.<API key>,
dataIndex: 'concatenated_name',
flex: 1,
sortable: false
}, {
header: this.dimension_1Label,
dataIndex: 'dimension_1',
flex: 1,
sortable: false
}, {
header: this.dimension_2Label,
dataIndex: 'dimension_2',
flex: 1,
sortable: false
}, {
header: this.size_typeLabel,
dataIndex: 'size_type',
flex: 1,
sortable: false,
renderer: Buildit.util.Format.lookupRenderer('SIZE_TYPE')
}, {
header: this.size_nbrLabel,
dataIndex: 'size_nbr',
flex: 1,
sortable: false
}, {
header: this.is_enabledLabel,
dataIndex: 'is_enabled',
flex: 1,
sortable: false
}, ]
});
// COLUMNS (End)
Ext.apply(this, {
title: 'Size',
subtitle: 'All Product Sizes that are valid in the system'
});
// TITLES (End)
this.callParent();
}
});
|
# The file 'enkf_node.py' is part of ERT - Ensemble based Reservoir Tool.
# ERT is free software: you can redistribute it and/or modify
# (at your option) any later version.
# ERT is distributed in the hope that it will be useful, but WITHOUT ANY
# FITNESS FOR A PARTICULAR PURPOSE.
# for more details.
from ert.cwrap import BaseCClass, CWrapper
from ert.enkf import ENKF_LIB, EnkfFs, NodeId
from ert.enkf.data import EnkfConfigNode, GenKw, GenData, CustomKW
from ert.enkf.enums import ErtImplType
class EnkfNode(BaseCClass):
def __init__(self, config_node, private=False):
assert isinstance(config_node, EnkfConfigNode)
if private:
c_pointer = EnkfNode.cNamespace().alloc_private(config_node)
else:
c_pointer = EnkfNode.cNamespace().alloc(config_node)
super(EnkfNode, self).__init__(c_pointer, config_node, True)
def valuePointer(self):
return EnkfNode.cNamespace().value_ptr(self)
def asGenData(self):
""" @rtype: GenData """
impl_type = EnkfNode.cNamespace().get_impl_type(self)
assert impl_type == ErtImplType.GEN_DATA
return GenData.createCReference(self.valuePointer(), self)
def asGenKw(self):
""" @rtype: GenKw """
impl_type = EnkfNode.cNamespace().get_impl_type(self)
assert impl_type == ErtImplType.GEN_KW
return GenKw.createCReference(self.valuePointer(), self)
def asCustomKW(self):
""" @rtype: CustomKW """
impl_type = EnkfNode.cNamespace().get_impl_type(self)
assert impl_type == ErtImplType.CUSTOM_KW
return CustomKW.createCReference(self.valuePointer(), self)
def tryLoad(self, fs, node_id):
"""
@type fs: EnkfFS
@type node_id: NodeId
@rtype: bool
"""
assert isinstance(fs, EnkfFs)
assert isinstance(node_id, NodeId)
return EnkfNode.cNamespace().try_load(self, fs, node_id)
def name(self):
return EnkfNode.cNamespace().get_name(self)
def load(self, fs, node_id):
if not self.tryLoad(fs, node_id):
raise Exception("Could not load node: %s iens: %d report: %d" % (self.name(), node_id.iens, node_id.report_step))
def save(self, fs, node_id):
assert isinstance(fs, EnkfFs)
assert isinstance(node_id, NodeId)
EnkfNode.cNamespace().store(self, fs, True, node_id)
def free(self):
EnkfNode.cNamespace().free(self)
cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("enkf_node", EnkfNode)
EnkfNode.cNamespace().free = cwrapper.prototype("void enkf_node_free(enkf_node)")
EnkfNode.cNamespace().alloc = cwrapper.prototype("c_void_p enkf_node_alloc(enkf_node)")
EnkfNode.cNamespace().alloc_private = cwrapper.prototype("c_void_p <API key>(enkf_node)")
EnkfNode.cNamespace().get_name = cwrapper.prototype("char* enkf_node_get_key(enkf_node)")
EnkfNode.cNamespace().value_ptr = cwrapper.prototype("c_void_p enkf_node_value_ptr(enkf_node)")
EnkfNode.cNamespace().try_load = cwrapper.prototype("bool enkf_node_try_load(enkf_node, enkf_fs, node_id)")
EnkfNode.cNamespace().get_impl_type = cwrapper.prototype("ert_impl_type_enum <API key>(enkf_node)")
EnkfNode.cNamespace().store = cwrapper.prototype("void enkf_node_store(enkf_node, enkf_fs, bool, node_id)")
|
package task_config
import (
"github.com/sonm-io/core/proto"
"github.com/sonm-io/core/util/config"
)
func LoadConfig(path string) (*sonm.TaskSpec, error) {
// Manual renaming from snake_case to lowercase fields here to be able to
// load them directly in the protobuf.
cfg := &sonm.TaskSpec{}
if err := config.LoadWith(cfg, path, config.SnakeToLower); err != nil {
return nil, err
}
if err := cfg.Validate(); err != nil {
return nil, err
}
return cfg, nil
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Web;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using LyricsFetcher;
using iTunesLib;
using WMPLib;
using WMFSDKWrapper;
public class TestSong : Song
{
public TestSong(string title, string artist, string album, string genre) :
base(title, artist, album, genre) {
}
public override string FullPath {
get { return String.Empty; }
}
public override void Commit() {
}
public override void GetLyrics() {
}
}
namespace LyricsFetcher.CommandLine
{
class Program
{
static void TestWMPLyrics() {
WindowsMediaPlayer wmpPlayer = new WindowsMediaPlayer();
IWMPPlaylist playlist = wmpPlayer.mediaCollection.getByAttribute("MediaType", "audio");
IWMPMedia media = playlist.get_Item(100);
Console.WriteLine(media.name);
Console.WriteLine(media.getItemInfo("Lyrics"));
//media.setItemInfo("Lyrics", "");
}
static void TestSecondTry() {
// Is it actually worthwhile doing the second or subsequent attempt?
ITunesLibrary lib = new ITunesLibrary();
//lib.MaxSongsToFetch = 1000;
lib.LoadSongs();
lib.WaitLoad();
List<Song> songs = lib.Songs.FindAll(
delegate(Song s) {
LyricsStatus status = s.LyricsStatus;
return (status == LyricsStatus.Untried ||
status == LyricsStatus.Failed ||
status == LyricsStatus.Success);
}
);
ILyricsSource source2 = new <API key>();
ILyricsSource source1 = new LyricsSourceLyrdb();
ILyricsSource source3 = new <API key>();
Stopwatch sw1 = new Stopwatch();
Stopwatch sw2 = new Stopwatch();
Stopwatch sw3 = new Stopwatch();
int failures = 0;
int success1 = 0;
int success2 = 0;
int success3 = 0;
foreach (Song song in songs) {
sw1.Start();
string lyrics = source1.GetLyrics(song);
sw1.Stop();
if (lyrics == string.Empty) {
sw2.Start();
lyrics = source2.GetLyrics(song);
sw2.Stop();
if (lyrics == string.Empty) {
sw3.Start();
lyrics = source3.GetLyrics(song);
sw3.Stop();
if (lyrics == string.Empty)
failures++;
else
success3++;
} else
success2++;
} else
success1++;
}
Console.WriteLine("1st try: successes: {0} ({1}%), time: {2} ({3} each)",
success1, (success1 * 100 / songs.Count), sw1.Elapsed, sw1.ElapsedMilliseconds / songs.Count);
Console.WriteLine("2st try: successes: {0} ({1}%), time: {2} ({3} each)",
success2, (success2 * 100 / songs.Count), sw2.Elapsed, sw2.ElapsedMilliseconds / (songs.Count - success1));
Console.WriteLine("3st try: successes: {0} ({1}%), time: {2} ({3} each)",
success3, (success3 * 100 / songs.Count), sw3.Elapsed, sw3.ElapsedMilliseconds / (songs.Count - success1 - success2));
Console.WriteLine("failures: {0} ({1}%)",
failures, (failures * 100 / songs.Count));
}
static void TestSources() {
ITunesLibrary lib = new ITunesLibrary();
lib.MaxSongsToFetch = 150;
lib.LoadSongs();
lib.WaitLoad();
List<Song> songs = lib.Songs.FindAll(
delegate(Song s) {
LyricsStatus status = s.LyricsStatus;
return (status == LyricsStatus.Untried ||
status == LyricsStatus.Failed ||
status == LyricsStatus.Success);
}
);
songs = songs.GetRange(0, 10);
//TestOneSource(songs, new <API key>());
//TestOneSource(songs, new <API key>());
TestOneSource(songs, new <API key>());
TestOneSource(songs, new LyricsSourceLyrdb());
TestOneSource(songs, new <API key>());
}
private static void TestOneSource(List<Song> songs, ILyricsSource source) {
Console.WriteLine("Testing {0}...", source.Name);
int successes = 0;
int failures = 0;
Stopwatch sw = new Stopwatch();
sw.Start();
foreach (Song song in songs) {
if (source.GetLyrics(song) == string.Empty)
failures++;
else
successes++;
}
sw.Stop();
Console.WriteLine("Successes: {0}, failure: {1}, time: {2} seconds ({3} per song)",
successes, failures, sw.Elapsed, sw.ElapsedMilliseconds / songs.Count);
}
static void lfm_StatusEvent(object sender, <API key> e)
{
System.Diagnostics.Debug.WriteLine(e.Status);
}
static void TestMetaDataEditor() {
string file = @"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\After the fire\Der Kommissar\01 Der Kommissar.wma";
using (MetaDataEditor mde = new MetaDataEditor(file)) {
//mde.SetFieldValue("WM/Lyrics", "These are some more of my favourite things");
//mde.SetFieldValue("WM/Genre", "80's rock");
Console.WriteLine(mde.GetFieldValue("WM/Year"));
Console.WriteLine(mde.GetFieldValue("WM/Lyrics"));
Console.WriteLine(mde.GetFieldValue("Genre"));
Console.WriteLine(mde.GetFieldValue("WM/Publisher"));
Console.WriteLine(mde.GetFieldValue("unknown"));
}
}
static void TestMetaDataEditor2() {
WindowsMediaPlayer wmpPlayer = new WindowsMediaPlayer();
IWMPPlaylist playlist = wmpPlayer.mediaCollection.getByAttribute("MediaType", "audio");
IWMPMedia media = playlist.get_Item(100);
Console.WriteLine(media.name);
Console.WriteLine(media.getItemInfo("WM/Genre"));
Console.WriteLine("-");
using (MetaDataEditor mde = new MetaDataEditor(media.sourceURL)) {
//mde.SetFieldValue("WM/Lyrics", "MORE LIKE THIS things");
//mde.SetFieldValue("WM/Genre", "80's rock");
Console.WriteLine(mde.GetFieldValue("WM/Year"));
Console.WriteLine(mde.GetFieldValue("WM/Lyrics"));
Console.WriteLine(mde.GetFieldValue("WM/Genre"));
Console.WriteLine(mde.GetFieldValue("WM/Publisher"));
Console.WriteLine(mde.GetFieldValue("unknown"));
}
}
static void TestLyricsSource() {
//ILyricsSource strategy = new <API key>();
//ILyricsSource strategy = new <API key>();
//ILyricsSource strategy = new LyricsSourceLyrdb();
//ILyricsSource strategy = new <API key>();
ILyricsSource strategy = new <API key>();
//TestSong song = new TestSong("Lips don't hie", "Shakira", "Music of the Sun", "");
//TestSong song = new TestSong("Hips don't lie", "Shakira", "Music of the Sun", "");
//TestSong song = new TestSong("Pon de replay", "Rihanna", "Music of the Sun", "");
//TestSong song = new TestSong("I Love to Move in Here", "Moby", "Last Night", "");
TestSong song = new TestSong("Year 3000", "Busted", "", "");
Console.WriteLine(song);
Console.WriteLine(strategy.GetLyrics(song));
}
static void TestMetaDataLookup() {
string file = @"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\After the fire\Der Kommissar\01 Der Kommissar.mp3";
//string file = @"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\Alanis Morissette\So-Called Chaos\01 Eight Easy Steps.mp3";
//string file = @"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\Unknown Artist\Unknown Album\16 Pump UP the jam.mp3";
//string file = @"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\Ziqo\Unknown Album\01 Vamos Embora.mp3";
MetaDataLookup req = new MetaDataLookup();
Console.WriteLine("looking up '{0}'...", file);
req.Lookup(file);
Console.WriteLine("puid={0}", req.MetaData.Puid);
Console.WriteLine("title={0}", req.MetaData.Title);
Console.WriteLine("artist={0}", req.MetaData.Artist);
Console.WriteLine("genre={0}", req.MetaData.Genre);
}
static void <API key>() {
ITunesLibrary lib = new ITunesLibrary();
lib.MaxSongsToFetch = 50;
lib.LoadSongs();
lib.WaitLoad();
Stopwatch sw = new Stopwatch();
sw.Start();
try {
foreach (Song song in lib.Songs) {
MetaDataLookup req = new MetaDataLookup();
//MetaDataLookupOld req = new MetaDataLookupOld();
req.Lookup(song);
if (req.Status == MetaDataStatus.Success) {
if (song.Title == req.MetaData.Title && song.Artist == req.MetaData.Artist)
System.Diagnostics.Debug.WriteLine(String.Format("same: {0}", song));
else
System.Diagnostics.Debug.WriteLine(String.Format("different: {0}. title={1}, artist={2}", song, req.MetaData.Title, req.MetaData.Artist));
} else {
System.Diagnostics.Debug.WriteLine(String.Format("failed: {0}", song));
}
}
}
finally {
sw.Stop();
System.Diagnostics.Debug.WriteLine(String.Format("Tried {0} song in {1} ({2} secs per song)", lib.Songs.Count, sw.Elapsed, (sw.ElapsedMilliseconds / lib.Songs.Count) / 1000));
}
}
static void Main(string[] args)
{
Console.WriteLine("start");
TestSources();
//<API key>();
//Console.WriteLine("start");
//string value = GetFieldByName(@"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\After the fire\Der Kommissar\01 Der Kommissar.mp3", "WM/Lyrics");
//Console.WriteLine(value);
//Console.WriteLine(GetFieldByName(@"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\After the fire\Der Kommissar\01 Der Kommissar.mp3", "WM/Genre"));
//Console.WriteLine(GetFieldByName(@"C:\Documents and Settings\Admin_2\My Documents\My Music\iTunes\iTunes Music\After the fire\Der Kommissar\01 Der Kommissar.mp3", "WM/Publisher"));
//Console.ReadKey();
//System.Diagnostics.Debug.WriteLine("start");
//Stopwatch watch = new Stopwatch();
//SongLibrary library = new WmpLibrary();
/SongLibrary library = new ITunesLibrary();
/library.MaxSongsToFetch = 1000;
//watch.Start();
//library.LoadSongs();
//library.WaitLoad();
//watch.Stop();
//System.Diagnostics.Debug.WriteLine(String.Format("Loaded {0} songs in {1}ms",
// library.Songs.Count, watch.ElapsedMilliseconds));
//LyricsFetchManager lfm = new LyricsFetchManager();
//lfm.AutoUpdateLyrics = true;
//lfm.StatusEvent += new EventHandler<<API key>>(lfm_StatusEvent);
//lfm.Sources.Add(new LyricsSourceLyrdb());
//lfm.Sources.Add(new <API key>());
//Song song = new TestSong("seconds", "u2", "Music of the Sun", "");
//lfm.Queue(song);
//lfm.Start();
//lfm.WaitUntilFinished();
//System.Diagnostics.Debug.WriteLine(song);
//System.Diagnostics.Debug.Write(song.Lyrics);
//System.Diagnostics.Debug.WriteLine(Wmp.Instance.Player.versionInfo);
//SongLibrary library = new WmpLibrary();
//library.MaxSongsToFetch = 100;
//foreach (Song x in library.Songs)
// System.Diagnostics.Debug.WriteLine(x);
//IWMPPlaylist playlist = Wmp.Instance.AllTracks;
//System.Diagnostics.Debug.WriteLine(Wmp.Instance.Player.versionInfo);
//for (int i = 0; i < playlist.count; i++) {
// IWMPMedia media = playlist.get_Item(i);
// System.Diagnostics.Debug.WriteLine(media.name);
Console.WriteLine("done");
Console.ReadKey();
}
}
}
|
#!/bin/sh
# AwesomeTTS text-to-speech add-on for Anki
# This program is free software: you can redistribute it and/or modify
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
addon_id="301952613"
set -e
if [ -z "$1" ]
then
echo 'Please specify your Anki addons directory.' 1>&2
echo 1>&2
echo " Usage: $0 <target>" 1>&2
echo " e.g.: $0 ~/.local/share/Anki2/addons21" 1>&2
exit 1
fi
target=${1%/}
case $target in
*/addons21)
;;
*)
echo 'Expected target path to end in "/addons21".' 1>&2
exit 1
esac
case $target in
|
#pragma once
#ifndef <API key>
#define <API key>
#include <array>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <hptt/types.h>
#include <hptt/tensor.h>
#include <hptt/arch/compat.h>
#include <hptt/util/util_trans.h>
#include <hptt/kernels/kernel_trans.h>
namespace hptt {
template <typename FloatType,
TensorUInt ORDER>
class TensorMergedWrapper : public TensorWrapper<FloatType, ORDER> {
public:
TensorMergedWrapper() = delete;
TensorMergedWrapper(const TensorWrapper<FloatType, ORDER> &tensor,
const std::unordered_set<TensorUInt> &merge_set);
HPTT_INL FloatType &operator[](const TensorIdx * RESTRICT indices);
HPTT_INL const FloatType &operator[](
const TensorIdx * RESTRICT indices) const;
HPTT_INL FloatType &operator[](TensorIdx **indices);
HPTT_INL const FloatType &operator[](const TensorIdx **indices) const;
private:
TensorUInt begin_order_idx_, merged_order_;
TensorUInt merge_idx_(const std::unordered_set<TensorUInt> &merge_set);
};
template <typename TensorType,
bool UPDATE_OUT>
struct ParamTrans {
// Type alias and constant values
using Float = typename TensorType::Float;
using Deduced = DeducedFloatType<Float>;
using KernelPack = KernelPackTrans<Float, UPDATE_OUT>;
static constexpr auto ORDER = TensorType::TENSOR_ORDER;
ParamTrans(const TensorType &input_tensor, TensorType &output_tensor,
const std::array<TensorUInt, ORDER> &perm, const Deduced alpha,
const Deduced beta);
HPTT_INL bool is_common_leading() const;
HPTT_INL void set_coef(const Deduced alpha, const Deduced beta);
HPTT_INL const KernelPack &get_kernel() const;
void <API key>(const TensorUInt size_kn_inld,
const TensorUInt size_kn_outld);
void <API key>(const TensorUInt size_kn_in_inld,
const TensorUInt size_kn_in_outld, const TensorUInt size_kn_out_inld,
const TensorUInt size_kn_out_outld);
void reset_data(const Float *data_in, Float *data_out);
private:
TensorUInt merge_idx_(const TensorType &input_tensor,
const TensorType &output_tensor,
const std::array<TensorUInt, ORDER> &perm);
// They need to be initialized before merging
std::unordered_set<TensorUInt> input_merge_set_, output_merge_set_;
KernelPackTrans<Float, UPDATE_OUT> kn_;
public:
std::array<TensorUInt, ORDER> perm;
Deduced alpha, beta;
TensorIdx stride_in_inld, stride_in_outld, stride_out_inld, stride_out_outld;
TensorUInt begin_order_idx;
const TensorUInt merged_order;
// Put the merged tensors here, they must be initialized after merging
TensorMergedWrapper<Float, ORDER> input_tensor, output_tensor;
};
/*
* Import implementation
*/
#include "parameter_trans.tcc"
}
#endif // <API key>
|
package tencentcloud.constant;
/**
* @author fanwh
* @version v1.0
* @decription
* @create on 2017/11/10 16:09
*/
public class RegionConstants {
public static final String PEKING = "ap-beijing";
public static final String SHANGHAI = "ap-shanghai";
public static final String HONGKONG = "ap-hongkong";
public static final String TORONTO = "na-toronto";
public static final String SILICON_VALLEY = "na-siliconvalley";
public static final String SINGAPORE = "ap-singapore";
public static final String SHANGHAI_FSI = "ap-shanghai-fsi";
/**
* open
*/
public static final String GUANGZHOU_OPEN = "ap-guangzhou-open";
public static final String SHENZHEN_FSI = "ap-shenzhen-fsi";
}
|
/* The following code was generated by JFlex 1.6.1 */
package com.jim_project.interprete.parser.previo;
import com.jim_project.interprete.parser.AnalizadorLexico;
public class PrevioLex extends AnalizadorLexico {
/** This character denotes the end of file */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
private static final int ZZ_BUFFERSIZE = 16384;
/** lexical states */
public static final int YYINITIAL = 0;
/**
* ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
* ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
* at the beginning of a line
* l is of the form l = 2*k, k a non negative integer
*/
private static final int ZZ_LEXSTATE[] = {
0, 0
};
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\0\1\3\1\2\1\51\1\3\1\1\22\0\1\3\1\16\1\0"+
"\1\5\1\0\1\20\2\0\3\20\1\15\1\20\1\14\1\0\1\20"+
"\1\10\11\7\2\0\1\13\1\17\3\0\3\6\1\50\1\42\1\24"+
"\1\30\1\40\1\23\2\4\1\41\1\4\1\47\1\31\1\44\3\4"+
"\1\32\2\4\1\37\1\11\1\12\1\11\1\20\1\0\1\20\3\0"+
"\3\6\1\46\1\36\1\22\1\25\1\34\1\21\2\4\1\35\1\4"+
"\1\45\1\26\1\43\3\4\1\27\2\4\1\33\1\11\1\12\1\11"+
"\12\0\1\51\u1fa2\0\1\51\1\51\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
/**
* Translates characters to character classes
*/
private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
/**
* Translates DFA states to action switch labels.
*/
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\1\0\1\1\2\2\1\1\1\2\1\3\2\4\2\5"+
"\1\1\2\6\1\1\1\6\6\1\1\3\2\1\1\3"+
"\1\7\1\3\1\5\1\10\1\11\1\12\1\0\1\13"+
"\10\7\1\14\4\7\1\15\2\7\1\16\1\7\1\17"+
"\1\7\1\20";
private static int [] zzUnpackAction() {
int [] result = new int[55];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAction(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/**
* Translates a state to a row index in the transition table
*/
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\52\0\124\0\52\0\176\0\250\0\322\0\374"+
"\0\52\0\u0126\0\176\0\u0150\0\u017a\0\u01a4\0\u01ce\0\52"+
"\0\u01f8\0\u0222\0\u024c\0\u0276\0\u02a0\0\u02ca\0\u02f4\0\u031e"+
"\0\u0348\0\u0372\0\176\0\u039c\0\u03c6\0\52\0\52\0\52"+
"\0\u03f0\0\176\0\u041a\0\u0444\0\u046e\0\u0498\0\u04c2\0\u04ec"+
"\0\u0516\0\u0540\0\52\0\u056a\0\u0594\0\u05be\0\u05e8\0\176"+
"\0\u0612\0\u063c\0\176\0\u0666\0\176\0\u0690\0\176";
private static int [] zzUnpackRowMap() {
int [] result = new int[55];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackRowMap(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
result[j++] = high | packed.charAt(i++);
}
return j;
}
/**
* The transition table of the DFA
*/
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\2\1\3\2\4\1\5\1\6\1\7\1\10\1\11"+
"\1\12\1\13\1\14\1\15\1\16\1\17\1\2\1\20"+
"\1\21\1\5\1\22\1\5\1\23\2\5\1\24\2\5"+
"\1\25\1\5\1\26\1\27\1\30\1\5\1\31\1\32"+
"\3\5\1\7\1\5\1\7\55\0\1\4\53\0\1\33"+
"\1\0\1\33\2\0\2\33\6\0\30\33\1\0\1\6"+
"\1\3\1\4\47\6\4\0\1\33\1\0\1\33\1\34"+
"\1\0\2\33\6\0\30\33\10\0\2\10\45\0\1\33"+
"\1\0\1\33\1\35\1\0\2\33\6\0\30\33\15\0"+
"\1\36\51\0\1\37\52\0\1\40\53\0\1\41\36\0"+
"\1\33\1\0\1\33\2\0\2\33\6\0\1\33\1\42"+
"\26\33\5\0\1\33\1\0\1\33\2\0\2\33\6\0"+
"\3\33\1\42\24\33\5\0\1\33\1\0\1\33\2\0"+
"\2\33\6\0\5\33\1\43\22\33\5\0\1\33\1\0"+
"\1\33\2\0\2\33\6\0\10\33\1\44\17\33\5\0"+
"\1\33\1\0\1\33\2\0\2\33\6\0\13\33\1\45"+
"\14\33\5\0\1\33\1\0\1\33\2\0\2\33\6\0"+
"\5\33\1\46\22\33\5\0\1\33\1\0\1\33\1\34"+
"\1\0\2\33\6\0\24\33\1\47\3\33\5\0\1\33"+
"\1\0\1\33\2\0\2\33\6\0\17\33\1\50\10\33"+
"\5\0\1\33\1\0\1\33\2\0\2\33\6\0\10\33"+
"\1\51\17\33\5\0\1\33\1\0\1\33\1\34\1\0"+
"\2\33\6\0\26\33\1\52\1\33\10\0\2\34\50\0"+
"\2\35\44\0\1\41\4\0\1\53\45\0\1\33\1\0"+
"\1\33\2\0\2\33\6\0\6\33\1\54\21\33\5\0"+
"\1\33\1\0\1\33\2\0\2\33\6\0\11\33\1\55"+
"\16\33\5\0\1\33\1\0\1\33\2\0\2\33\6\0"+
"\1\56\27\33\5\0\1\33\1\0\1\33\2\0\2\33"+
"\6\0\5\33\1\57\22\33\5\0\1\33\1\0\1\33"+
"\2\0\2\33\6\0\25\33\1\60\2\33\5\0\1\33"+
"\1\0\1\33\2\0\2\33\6\0\2\33\1\61\25\33"+
"\5\0\1\33\1\0\1\33\2\0\2\33\6\0\10\33"+
"\1\62\17\33\5\0\1\33\1\0\1\33\2\0\2\33"+
"\6\0\27\33\1\60\5\0\1\33\1\0\1\33\2\0"+
"\2\33\6\0\5\33\1\63\22\33\5\0\1\33\1\0"+
"\1\33\2\0\2\33\6\0\10\33\1\63\17\33\5\0"+
"\1\33\1\0\1\33\2\0\2\33\6\0\14\33\1\64"+
"\13\33\5\0\1\33\1\0\1\33\2\0\2\33\6\0"+
"\22\33\1\65\5\33\5\0\1\33\1\0\1\33\2\0"+
"\2\33\6\0\20\33\1\66\7\33\5\0\1\33\1\0"+
"\1\33\2\0\2\33\6\0\23\33\1\65\4\33\5\0"+
"\1\33\1\0\1\33\2\0\2\33\6\0\15\33\1\67"+
"\12\33\5\0\1\33\1\0\1\33\2\0\2\33\6\0"+
"\21\33\1\67\6\33\1\0";
private static int [] zzUnpackTrans() {
int [] result = new int[1722];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackTrans(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
value
do result[j++] = value; while (--count > 0);
}
return j;
}
/* error codes */
private static final int ZZ_UNKNOWN_ERROR = 0;
private static final int ZZ_NO_MATCH = 1;
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String ZZ_ERROR_MSG[] = {
"Unknown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String <API key> =
"\1\0\1\11\1\1\1\11\4\1\1\11\6\1\1\11"+
"\15\1\3\11\1\0\11\1\1\11\14\1";
private static int [] zzUnpackAttribute() {
int [] result = new int[55];
int offset = 0;
offset = zzUnpackAttribute(<API key>, offset, result);
return result;
}
private static int zzUnpackAttribute(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/** the input device */
private java.io.Reader zzReader;
/** the current state of the DFA */
private int zzState;
/** the current lexical state */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
private int zzMarkedPos;
/** the current text position in the buffer */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
*/
private int yycolumn;
/**
* zzAtBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/**
* The number of occupied positions in zzBuffer beyond zzEndRead.
* When a lead/high surrogate has been read from the input stream
* into the final zzBuffer position, this will have a value of 1;
* otherwise, it will have a value of 0.
*/
private int <API key> = 0;
/* user code: */
private PrevioParser yyparser;
public PrevioLex(java.io.Reader r, PrevioParser p) {
this(r);
yyparser = p;
}
/**
* Creates a new scanner
*
* @param in the java.io.Reader to read input from.
*/
public PrevioLex(java.io.Reader in) {
this.zzReader = in;
}
/**
* Unpacks the compressed character translation table.
*
* @param packed the packed character translation table
* @return the unpacked character translation table
*/
private static char [] zzUnpackCMap(String packed) {
char [] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 184) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; while (--count > 0);
}
return map;
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
zzEndRead += <API key>;
<API key> = 0;
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
<API key>);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzStartRead = 0;
}
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length - <API key>) {
/* if not: blow it up */
char newBuffer[] = new char[zzBuffer.length*2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
zzEndRead += <API key>;
<API key> = 0;
}
/* fill the buffer with new input */
int requested = zzBuffer.length - zzEndRead;
int numRead = zzReader.read(zzBuffer, zzEndRead, requested);
/* not supposed to occur according to specification of java.io.Reader */
if (numRead == 0) {
throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround.");
}
if (numRead > 0) {
zzEndRead += numRead;
/* If numRead == requested, we might have requested to few chars to
encode a full Unicode character. We assume that a Reader would
otherwise never return half characters. */
if (numRead == requested) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
--zzEndRead;
<API key> = 1;
}
}
/* potentially more input available */
return false;
}
/* numRead < 0 ==> end of stream */
return true;
}
/**
* Closes the input stream.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
*
* Internal scan buffer is resized down to its initial length, if it has grown.
*
* @param reader the new input stream
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
<API key> = 0;
yyline = yychar = yycolumn = 0;
zzLexicalState = YYINITIAL;
if (zzBuffer.length > ZZ_BUFFERSIZE)
zzBuffer = new char[ZZ_BUFFERSIZE];
}
/**
* Returns the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
public final void yybegin(int newState) {
zzLexicalState = newState;
}
/**
* Returns the text matched by the current regular expression.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, <API key> );
}
/**
* Returns the character at position <tt>pos</tt> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
*
* @return the character at position pos
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
}
/**
* Returns the length of the matched text region.
*/
public final int yylength() {
return <API key>;
}
/**
* Reports an error that occured while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
*
* @param errorCode the code of the errormessage to display
*/
private void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (<API key> e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
*/
public void yypushback(int number) {
if ( number > yylength() )
zzScanError(ZZ_PUSHBACK_2BIG);
zzMarkedPos -= number;
}
/**
* Contains user EOF-code, which will be executed exactly once,
* when the end of file is reached
*/
private void zzDoEOF() throws java.io.IOException {
if (!zzEOFDone) {
zzEOFDone = true;
yyclose();
}
}
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/
public int yylex() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMapL = ZZ_ROWMAP;
int [] zzAttrL = ZZ_ATTRIBUTE;
while (true) {
zzMarkedPosL = zzMarkedPos;
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
zzState = ZZ_LEXSTATE[zzLexicalState];
// set up zzAction for empty match case:
int zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
}
zzForAction: {
while (true) {
if (zzCurrentPosL < zzEndReadL) {
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
zzCurrentPosL += Character.charCount(zzInput);
}
else if (zzAtEOF) {
zzInput = YYEOF;
break zzForAction;
}
else {
// store back cached positions
zzCurrentPos = zzCurrentPosL;
zzMarkedPos = zzMarkedPosL;
boolean eof = zzRefill();
// get translated positions and possibly new buffer
zzCurrentPosL = zzCurrentPos;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
zzEndReadL = zzEndRead;
if (eof) {
zzInput = YYEOF;
break zzForAction;
}
else {
zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
zzCurrentPosL += Character.charCount(zzInput);
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
if ( (zzAttributes & 8) == 8 ) break zzForAction;
}
}
}
// store back cached position
zzMarkedPos = zzMarkedPosL;
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
zzDoEOF();
{ return 0; }
}
else {
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
case 1:
{ yyparser.programa().error().<API key>(yytext());
}
case 17: break;
case 2:
{
}
case 18: break;
case 3:
{ yyparser.yylval = new PrevioParserVal(yytext());
return PrevioParser.ETIQUETA;
}
case 19: break;
case 4:
{ yyparser.yylval = new PrevioParserVal(yytext());
return PrevioParser.NUMERO;
}
case 20: break;
case 5:
{ yyparser.yylval = new PrevioParserVal(yytext());
return PrevioParser.VARIABLE;
}
case 21: break;
case 6:
{ return yycharat(0);
}
case 22: break;
case 7:
{ yyparser.yylval = new PrevioParserVal(yytext());
return PrevioParser.IDMACRO;
}
case 23: break;
case 8:
{ return PrevioParser.FLECHA;
}
case 24: break;
case 9:
{ return PrevioParser.DECREMENTO;
}
case 25: break;
case 10:
{ return PrevioParser.INCREMENTO;
}
case 26: break;
case 11:
{ return PrevioParser.IF;
}
case 27: break;
case 12:
{ return PrevioParser.DISTINTO;
}
case 28: break;
case 13:
{ return PrevioParser.END;
}
case 29: break;
case 14:
{ return PrevioParser.GOTO;
}
case 30: break;
case 15:
{ return PrevioParser.LOOP;
}
case 31: break;
case 16:
{ return PrevioParser.WHILE;
}
case 32: break;
default:
zzScanError(ZZ_NO_MATCH);
}
}
}
}
}
|
#include "cdi.h"
#include "mds_reader.h"
#include "common.h"
SessionInfo mds_ses;
TocInfo mds_toc;
DiscType mds_Disctype=CdRom;
struct file_TrackInfo
{
u32 FAD;
u32 Offset;
u32 SectorSize;
};
file_TrackInfo mds_Track[101];
FILE* fp_mdf=0;
u8 mds_SecTemp[5120];
u32 mds_TrackCount;
u32 mds_ReadSSect(u8* p_out,u32 sector,u32 secsz)
{
for (u32 i=0;i<mds_TrackCount;i++)
{
if (mds_Track[i+1].FAD>sector)
{
u32 fad_off=sector-mds_Track[i].FAD;
fseek(fp_mdf,mds_Track[i].Offset+fad_off*mds_Track[i].SectorSize,SEEK_SET);
fread(mds_SecTemp,mds_Track[i].SectorSize,1,fp_mdf);
ConvertSector(mds_SecTemp,p_out,mds_Track[i].SectorSize,secsz,sector);
return mds_Track[i].SectorSize;
}
}
return 0;
}
void FASTCALL mds_DriveReadSector(u8 * buff,u32 StartSector,u32 SectorCount,u32 secsz)
{
// printf("MDS/NRG->Read : Sector %d , size %d , mode %d \n",StartSector,SectorCount,secsz);
while(SectorCount
{
mds_ReadSSect(buff,StartSector,secsz);
buff+=secsz;
StartSector++;
}
}
void mds_CreateToc()
{
//clear structs to 0xFF :)
memset(mds_Track,0xFF,sizeof(mds_Track));
memset(&mds_ses,0xFF,sizeof(mds_ses));
memset(&mds_toc,0xFF,sizeof(mds_toc));
printf("\n--GD toc info start
int track=0;
bool CD_DA=false;
bool CD_M1=false;
bool CD_M2=false;
strack* last_track=&sessions[nsessions-1].tracks[sessions[nsessions-1].ntracks-1];
mds_ses.SessionCount=nsessions;
mds_ses.SessionsEndFAD=last_track->sector+last_track->sectors+150;
mds_toc.LeadOut.FAD=last_track->sector+last_track->sectors+150;
mds_toc.LeadOut.Addr=0;
mds_toc.LeadOut.Control=0;
mds_toc.LeadOut.Session=0;
printf("Last Sector : %d\n",mds_ses.SessionsEndFAD);
printf("Session count : %d\n",mds_ses.SessionCount);
mds_toc.FistTrack=1;
for (int s=0;s<nsessions;s++)
{
printf("Session %d:\n",s);
session* ses=&sessions[s];
printf(" Track Count: %d\n",ses->ntracks);
for (int t=0;t< ses->ntracks ;t++)
{
strack* c_track=&ses->tracks[t];
//pre gap
if (t==0)
{
mds_ses.SessionFAD[s]=c_track->sector+150;
mds_ses.SessionStart[s]=track+1;
printf(" Session start FAD: %d\n",mds_ses.SessionFAD[s]);
}
//verify(cdi_track->dwIndexCount==2);
printf(" track %d:\n",t);
printf(" Type : %d\n",c_track->mode);
if (c_track->mode>=2)
CD_M2=true;
if (c_track->mode==1)
CD_M1=true;
if (c_track->mode==0)
CD_DA=true;
//verify((c_track->mode==236) || (c_track->mode==169))
mds_toc.tracks[track].Addr=0;//hmm is that ok ?
mds_toc.tracks[track].Session=s;
mds_toc.tracks[track].Control=c_track->mode>0?4:0;//mode 1 , 2 , else are data , 0 is audio :)
mds_toc.tracks[track].FAD=c_track->sector+150;
mds_Track[track].FAD=mds_toc.tracks[track].FAD;
mds_Track[track].SectorSize=c_track->sectorsize;
mds_Track[track].Offset=(u32)c_track->offset;
printf(" Start FAD : %d\n",mds_Track[track].FAD);
printf(" SectorSize : %d\n",mds_Track[track].SectorSize);
printf(" File Offset : %d\n",mds_Track[track].Offset);
//main track data
track++;
}
}
//normal CDrom : mode 1 tracks .All sectors on the track are mode 1.Mode 2 was defined on the same book , but is it ever used? if yes , how can i detect
//cd XA ???
//CD Extra : session 1 is audio , session 2 is data
//cd XA : mode 2 tracks.Form 1/2 are selected per sector.It allows mixing of mode1/mode2 tracks ?
//CDDA : audio tracks only <- thats simple =P
/*
if ((CD_M1==true) && (CD_DA==false) && (CD_M2==false))
mds_Disctype = CdRom;
else if (CD_M2)
mds_Disctype = CdRom_XA;
else if (CD_DA && CD_M1)
mds_Disctype = CdRom_Extra;
else
mds_Disctype=CdRom;//hmm?
*/
if (nsessions==1 && (CD_M1 | CD_M2))
mds_Disctype = CdRom; //hack so that non selfboot stuff works on utopia
else
{
if ((CD_M1==true) && (CD_DA==false) && (CD_M2==false))
mds_Disctype = CdRom; //is that even correct ? what if its multysessions ? ehh ? what then ???
else if (CD_M2)
mds_Disctype = CdRom_XA; // XA XA ! its mode 2 wtf ?
else if (CD_DA && CD_M1)
mds_Disctype = CdRom_XA; //data + audio , duno wtf as@!#$ lets make it _XA since it seems to boot
else if (CD_DA && !CD_M1 && !CD_M2)
mds_Disctype = CdDA; //audio
else
mds_Disctype=CdRom_XA;//and hope for the best
}
/*
bool data = CD_M1 | CD_M2;
bool audio=CD_DA;
if (data && audio)
mds_Disctype = CdRom_XA; //Extra/CdRom won't boot , so meh
else if (data)
mds_Disctype = CdRom; //only data
else
mds_Disctype = CdDA; //only audio
*/
mds_toc.LastTrack=track;
mds_TrackCount=track;
printf("--GD toc info end
}
bool mds_init(wchar* file)
{
wchar fn[512]=L"";
bool rv=false;
if (rv==false && parse_mds(file,false))
{
bool found=false;
if (wcslen(file)>4)
{
wcscpy(&fn[0],file);
size_t len=wcslen(fn);
wcscpy(&fn[len-4],L".mdf");
fp_mdf=_tfopen(fn,L"rb");
found=fp_mdf!=0;
}
if (!found)
{
if (GetFile(fn,L"mds images (*.mds) \0*.mdf\0\0")==1)
{
fp_mdf=_tfopen(fn,L"rb");
found=true;
}
}
if (!found)
return false;
rv=true;
}
if (rv==false && parse_nrg(file,false))
{
rv=true;
fp_mdf=_tfopen(file,L"rb");
}
if (rv==false)
return false;
/*
for(int j=0;j<nsessions;j++)
for(int i=0;i<sessions[j].ntracks;i++)
{
printf("Session %d Track %d mode %d/%d sector %d count %d offset %I64d\n",
sessions[j].session_,
sessions[j].tracks[i].track,
sessions[j].tracks[i].mode,
sessions[j].tracks[i].sectorsize,
sessions[j].tracks[i].sector,
sessions[j].tracks[i].sectors,
sessions[j].tracks[i].offset);
}*/
mds_CreateToc();
return true;
}
void mds_term()
{
if (fp_mdf)
fclose(fp_mdf);
fp_mdf=0;
}
u32 FASTCALL <API key>()
{
return mds_Disctype;
}
void mds_DriveGetTocInfo(TocInfo* toc,DiskArea area)
{
verify(area==SingleDensity);
memcpy(toc,&mds_toc,sizeof(TocInfo));
}
void mds_GetSessionsInfo(SessionInfo* sessions)
{
memcpy(sessions,&mds_ses,sizeof(SessionInfo));
}
struct MDSDiskWrapper : Disc
{
MDSDiskWrapper() {
}
bool TryOpen(wchar* file) {
if (mds_init(file)) {
//printf("Session count %d:\n",nsessions);
//s32 tr_c = 1;
for (s32 s=0;s<nsessions;++s) {
//printf("Session %d:\n",s);
session* ses=&mds_sessions[s];
//printf(" Track Count: %d\n",ses->ntracks);
Track tr;
for (s32 t=0;t< ses->ntracks;++t) {
strack* c_track=&ses->tracks[t];
if (t==0) {
Session ts;
ts.FirstTrack = t + 1;//(tr_c++);
ts.StartFAD = c_track->sector+150;
sessions.push_back(ts);
//printf(" Session start FAD: %d\n",mds_ses.SessionFAD[s]);
}
tr.ADDR = 0;
tr.StartFAD = c_track->sector+150;
tr.EndFAD = 0;
tr.CTRL = c_track->mode>0?4:0;
//printf("SECTOR SIZE %u\n",c_track->sectorsize);
tr.file = new RawTrackFile(fp_mdf,(u32)c_track->offset,tr.StartFAD,c_track->sectorsize,false);
tracks.push_back(tr);
}
}
type=mds_Disctype;
LeadOut.ADDR=0;
LeadOut.CTRL=0;
LeadOut.StartFAD=549300;
EndFAD=549300;
return true;
}
return false;
}
~MDSDiskWrapper() {
mds_term();
}
};
Disc* mds_parse(wchar* fname) {
MDSDiskWrapper* dsk = new MDSDiskWrapper();
if (!dsk) {
return 0;
}
if (dsk->TryOpen(fname)) {
wprintf(L"\n\n Loaded %s\n\n",fname);
} else {
wprintf(L"\n\n Unable to load %s \n\n",fname);
delete dsk;
return 0;
}
return dsk;
}
|
<!DOCTYPE html>
<html>
<head>
<title></title>
<!--Import Google Icon Font
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<!--Import jQuery before materialize.js
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script></head>
<body>
<a class="btn btn-floating btn-large waves-effect waves-light red"><i class="material-icons">add</i></a>
<a class="waves-effect waves-teal btn-flat">Button</a>
</body>
</html>
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ksana Humanity Platform</title>
<!--<script src="../node_webkit/jslib/ksanajslib.min.js"></script>
<script src="../node_webkit/jslib/require.js" data-main="../node_webkit/jslib/ksanajslib"></script>
<link rel="stylesheet" href="../node_webkit/css/bootstrap.css"></link>
<link rel="stylesheet" href="css/tags.css"></link>
</head>
<body style="overflow-x:hidden;">
<div class="mainview">
<div class="rows">
<div class="col-5" data-aura-widget="controller-widget"></div>
<div class="col-7" data-aura-widget="tagset-widget"></div>
</div>
<div class="col-12" data-id="markable1" data-aura-widget="markable-widget"></div>
</div>
</body>
</html>
|
package visGrid.diagram.edit.parts;
import java.io.File;
import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.<API key>;
import org.eclipse.gmf.runtime.diagram.ui.l10n.<API key>;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.<API key>;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.text.contentassist.<API key>;
import org.eclipse.jface.viewers.<API key>;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
public class <API key> extends CompartmentEditPart implements
ITextAwareEditPart {
/**
* @generated
*/
public static final int VISUAL_ID = 5072;
/**
* @generated
*/
private DirectEditManager manager;
/**
* @generated
*/
private IParser parser;
/**
* @generated
*/
private List<?> parserElements;
/**
* @generated
*/
private String defaultText;
/**
* @generated
*/
public <API key>(View view) {
super(view);
}
/**
* @generated
*/
protected void <API key>() {
super.<API key>();
installEditPolicy(
EditPolicy.<API key>,
new visGrid.diagram.edit.policies.<API key>());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
new <API key>());
installEditPolicy(
EditPolicy.PRIMARY_DRAG_ROLE,
new visGrid.diagram.edit.parts.GridEditPart.NodeLabelDragPolicy());
}
/**
* @generated
*/
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
} else {
return ((Label) figure).getText();
}
}
/**
* @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
} else {
((Label) figure).setText(text);
}
}
/**
* @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
} else {
return ((Label) figure).getIcon();
}
}
/**
* @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
} else {
((Label) figure).setIcon(icon);
}
}
/**
* @generated
*/
public void setLabel(WrappingLabel figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
registerVisuals();
refreshVisuals();
}
/**
* @generated
*/
@SuppressWarnings("rawtypes")
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
public IGraphicalEditPart <API key>(String semanticHint) {
return null;
}
/**
* @generated
*/
protected EObject getParserElement() {
return <API key>();
}
/**
* @generated
*/
protected Image getLabelIcon() {
EObject parserElement = getParserElement();
if (parserElement == null) {
return null;
}
return visGrid.diagram.providers.VisGridElementTypes
.getImage(parserElement.eClass());
}
/**
* @generated
*/
protected String getLabelText() {
String text = null;
EObject parserElement = getParserElement();
if (parserElement != null && getParser() != null) {
text = getParser().getPrintString(
new EObjectAdapter(parserElement),
getParserOptions().intValue());
}
if (text == null || text.length() == 0) {
text = defaultText;
}
return text;
}
/**
* @generated
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if (pdEditPolicy instanceof visGrid.diagram.edit.policies.<API key>) {
((visGrid.diagram.edit.policies.<API key>) pdEditPolicy)
.refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.<API key>);
if (sfEditPolicy instanceof visGrid.diagram.edit.policies.<API key>) {
((visGrid.diagram.edit.policies.<API key>) sfEditPolicy)
.refreshFeedback();
}
}
/**
* @generated
*/
public String getEditText() {
if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
return getParser().getEditString(
new EObjectAdapter(getParserElement()),
getParserOptions().intValue());
}
/**
* @generated
*/
protected boolean isEditable() {
return getParser() != null;
}
/**
* @generated
*/
public <API key> <API key>() {
return new <API key>() {
public String isValid(final Object value) {
if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
.runExclusive(
new RunnableWithResult.Impl<IParserEditStatus>() {
public void run() {
setResult(parser
.isValidEditString(
new EObjectAdapter(
element),
(String) value));
}
});
return valid.getCode() == ParserEditStatus.EDITABLE ? null
: valid.getMessage();
} catch (<API key> ie) {
ie.printStackTrace();
}
}
// shouldn't get here
return null;
}
};
}
/**
* @generated
*/
public <API key> <API key>() {
if (getParserElement() == null || getParser() == null) {
return null;
}
return getParser().<API key>(
new EObjectAdapter(getParserElement()));
}
/**
* @generated
*/
public ParserOptions getParserOptions() {
return ParserOptions.NONE;
}
/**
* @generated
*/
public IParser getParser() {
if (parser == null) {
parser = visGrid.diagram.providers.<API key>
.getParser(
visGrid.diagram.providers.VisGridElementTypes.Series_reactor_2032,
getParserElement(),
visGrid.diagram.part.<API key>
.getType(visGrid.diagram.edit.parts.<API key>.VISUAL_ID));
}
return parser;
}
/**
* @generated
*/
protected DirectEditManager getManager() {
if (manager == null) {
setManager(new <API key>(this,
<API key>.<API key>(this),
visGrid.diagram.edit.parts.<API key>
.<API key>(this)));
}
return manager;
}
/**
* @generated
*/
protected void setManager(DirectEditManager manager) {
this.manager = manager;
}
/**
* @generated
*/
protected void performDirectEdit() {
getManager().show();
}
/**
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
if (getManager().getClass() == <API key>.class) {
((<API key>) getManager()).show(eventLocation
.getSWTPoint());
}
}
/**
* @generated
*/
private void performDirectEdit(char initialCharacter) {
if (getManager() instanceof <API key>) {
((<API key>) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
}
/**
* @generated
*/
protected void <API key>(Request request) {
final Request theRequest = request;
try {
getEditingDomain().runExclusive(new Runnable() {
public void run() {
if (isActive() && isEditable()) {
if (theRequest
.getExtendedData()
.get(RequestConstants.<API key>) instanceof Character) {
Character initialChar = (Character) theRequest
.getExtendedData()
.get(RequestConstants.<API key>);
performDirectEdit(initialChar.charValue());
} else if ((theRequest instanceof DirectEditRequest)
&& (getEditText().equals(getLabelText()))) {
DirectEditRequest editRequest = (DirectEditRequest) theRequest;
performDirectEdit(editRequest.getLocation());
} else {
performDirectEdit();
}
}
}
});
} catch (<API key> e) {
e.printStackTrace();
}
}
/**
* @generated
*/
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
refreshFont();
refreshFontColor();
refreshUnderline();
<API key>();
refreshBounds();
}
/**
* @generated
*/
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if (pdEditPolicy instanceof visGrid.diagram.edit.policies.<API key>) {
((visGrid.diagram.edit.policies.<API key>) pdEditPolicy)
.refreshFeedback();
}
Object sfEditPolicy = getEditPolicy(EditPolicy.<API key>);
if (sfEditPolicy instanceof visGrid.diagram.edit.policies.<API key>) {
((visGrid.diagram.edit.policies.<API key>) sfEditPolicy)
.refreshFeedback();
}
}
/**
* @generated
*/
protected void refreshUnderline() {
FontStyle style = (FontStyle) <API key>().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
}
/**
* @generated
*/
protected void <API key>() {
FontStyle style = (FontStyle) <API key>().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).<API key>(style
.isStrikeThrough());
}
}
/**
* @generated
*/
protected void refreshFont() {
FontStyle style = (FontStyle) <API key>().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
FontData fontData = new FontData(style.getFontName(),
style.getFontHeight(), (style.isBold() ? SWT.BOLD
: SWT.NORMAL)
| (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
/**
* @generated
*/
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
/**
* @generated
*/
protected void <API key>() {
if (getParser() instanceof ISemanticParser) {
EObject element = <API key>();
parserElements = ((ISemanticParser) getParser())
.<API key>(element);
for (int i = 0; i < parserElements.size(); i++) {
addListenerFilter(
"SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
}
} else {
super.<API key>();
}
}
/**
* @generated
*/
protected void <API key>() {
if (parserElements != null) {
for (int i = 0; i < parserElements.size(); i++) {
<API key>("SemanticModel" + i); //$NON-NLS-1$
}
} else {
super.<API key>();
}
}
/**
* @generated
*/
protected AccessibleEditPart <API key>() {
if (accessibleEP == null) {
accessibleEP = new <API key>() {
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
};
}
return accessibleEP;
}
/**
* @generated
*/
private View <API key>() {
return getPrimaryView();
}
/**
* @generated
*/
protected void <API key>() {
super.<API key>();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
}
/**
* @generated
*/
protected void <API key>() {
super.<API key>();
<API key>("PrimaryView"); //$NON-NLS-1$
}
/**
* @generated
*/
protected void refreshBounds() {
int width = ((Integer) <API key>(NotationPackage.eINSTANCE
.getSize_Width())).intValue();
int height = ((Integer) <API key>(NotationPackage.eINSTANCE
.getSize_Height())).intValue();
Dimension size = new Dimension(width, height);
int x = ((Integer) <API key>(NotationPackage.eINSTANCE
.getLocation_X())).intValue();
int y = ((Integer) <API key>(NotationPackage.eINSTANCE
.getLocation_Y())).intValue();
Point loc = new Point(x, y);
((GraphicalEditPart) getParent()).setLayoutConstraint(this,
getFigure(), new Rectangle(loc, size));
}
/**
* @generated
*/
protected void <API key>(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
|| NotationPackage.eINSTANCE.getSize_Height().equals(feature)
|| NotationPackage.eINSTANCE.getLocation_X().equals(feature)
|| NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
refreshBounds();
}
if (NotationPackage.eINSTANCE.<API key>().equals(feature)) {
Integer c = (Integer) event.getNewValue();
setFontColor(<API key>.getInstance().getColor(c));
} else if (NotationPackage.eINSTANCE.<API key>().equals(
feature)) {
refreshUnderline();
} else if (NotationPackage.eINSTANCE.<API key>()
.equals(feature)) {
<API key>();
} else if (NotationPackage.eINSTANCE.<API key>().equals(
feature)
|| NotationPackage.eINSTANCE.<API key>().equals(
feature)
|| NotationPackage.eINSTANCE.getFontStyle_Bold()
.equals(feature)
|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(
feature)) {
refreshFont();
} else {
if (getParser() != null
&& getParser().isAffectingEvent(event,
getParserOptions().intValue())) {
refreshLabel();
}
if (getParser() instanceof ISemanticParser) {
ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.<API key>(null, event)) {
<API key>();
if (<API key>() != null) {
<API key>();
}
refreshLabel();
}
}
}
super.<API key>(event);
}
/**
* @generated
*/
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
}
}
|
#include "mainwindow.h"
#include <exception>
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//setWindowFlags(Qt::CustomizeWindowHint);
menuBar()->close();
setStyleSheet("QPushButton{"
"background-color:gray;"
"color: white;"
"width:55px;"
"height:55px;"
"font-size: 15px;"
"border-radius: 10px;"
"border: 2px groove gray;"
"border-style: outset;}"
"QPushButton:hover{"
"background-color:white;"
"color: black;}"
"QPushButton:pressed,QPushButton:disabled{"
"color: white;"
"background-color:rgb(0, 0, 0);"
"border-style: inset; }");
CentralWidget=new QWidget(this);
setCentralWidget(CentralWidget);
setWindowTitle(tr("Calculator"));
buttonsLayout = new QGridLayout();
/*
* BUTTONS,
*/
for(int i=0; i<BUTTONS.size(); ++i)
{
QVector<string> row = BUTTONS.at(i);
for(int j=0; j<row.size(); ++j)
{
const string &symbol = row.at(j);
if(!(symbol.empty()))
{
PushButton *pushButton = new PushButton(QString::fromStdString(symbol));
buttons.push_back(pushButton);
connect(pushButton,&PushButton::clicked,this,&MainWindow::setInputText);
buttonsLayout->addWidget(pushButton, i, j);
}
}
}
<API key>=new QPushButton(QString::fromStdString(CLEAR));
<API key>=new QPushButton(QString::fromStdString(BACKSPACE));
<API key>=new QPushButton(QString::fromStdString(ANS));
<API key>=new QPushButton(QString::fromStdString(SHIFT));
equalButton = new QPushButton(QString::fromStdString(EQUAL));
connect(<API key>,&QPushButton::clicked,this,&MainWindow::onBackspaceClicked);
connect(<API key>,&QPushButton::clicked,this,&MainWindow::onClearClicked);
connect(<API key>,&QPushButton::clicked,this,&MainWindow::onAnsClicked);
connect(<API key>,&QPushButton::clicked,this,&MainWindow::onShiftClicked);
connect(equalButton, &QPushButton::clicked, this, &MainWindow::onEqualClicked);
buttonsLayout->addWidget(<API key>, 1, 0);
buttonsLayout->addWidget(<API key>, 1, 1);
buttonsLayout->addWidget(<API key>, 1, 2);
buttonsLayout->addWidget(<API key>, 0, 4);
buttonsLayout->addWidget(equalButton, BUTTONS.size(), BUTTONS.at(BUTTONS.size()-1).size()-2, 1, 2);
MainLayout=new QGridLayout(CentralWidget);
inputText=new QLineEdit("0");
inputText->setAlignment(Qt::AlignRight);
inputText->setReadOnly(true);
inputText->setStyleSheet("QLineEdit{height: 50px;"
"border-style: plain;"
"border-radius: 10px;"
"font-size: 30px}");
equalLabel = new QLabel("=");
equalLabel->setStyleSheet("width:55px;"
"height:55px;"
"font-size: 30px;");
resultText = new QLineEdit("0");
resultText->setReadOnly(true);
resultText->setStyleSheet("QLineEdit{height: 50px;"
"border-style: plain;"
"border-radius: 10px;"
"font-size: 30px}");
MainLayout->addWidget(inputText, 0, 0, 1, 5);
MainLayout->addWidget(equalLabel, 1, 1);
MainLayout->addWidget(resultText, 1, 2, 1, 3);
MainLayout->addLayout(buttonsLayout, 2, 0, 7, 5);
MainLayout->setSizeConstraint(QLayout::SetFixedSize);
setFixedSize(MainLayout->sizeHint());
}
MainWindow::~MainWindow()
{
}
QString MainWindow::cal(QString s)
{
QString temp;
expression = new Expression(<API key>(s));
try
{
temp=QString::fromStdString(expression->getResult());
}catch(runtime_error e){
QMessageBox messagebox(QMessageBox::Warning,"",QString::fromStdString(e.what()));
messagebox.exec();
temp = "Error";
}
calcFinished = true;
delete expression;
return temp;
}
string MainWindow::<API key>(QString expression)
{
expression = expression.replace("×", "*").replace("÷", "/").replace("√", "
return expression.toStdString();
}
void MainWindow::setInputText(PushButton *pushButton)
{
QString symbol = pushButton->text();
if(calcFinished==false)
{
inputText->setText(inputText->text()+pushButton->text());
}
else
{
Metacharacter m = METACHARACTERS.at(<API key>(symbol));
if(m.type == 0 || m.type == 2 || (m.type==1 && (m.position == 1 || m.e == "
{
if(symbol == ".")
{
inputText->setText(QString("0."));
}
else
{
inputText->setText(pushButton->text());
}
}
else if(m.type == 1)
{
inputText->setText(Ans + pushButton->text());
}
historySize.clear();
calcFinished=false;
}
historySize.push(pushButton->text().size());
}
void MainWindow::onEqualClicked()
{
QString temp;
temp=cal(inputText->text());
if(temp=="Error")
{
resultText->setText(tr("Error"));
Ans = "0";
return;
}
/*
* doubleQString,0,,0
*/
while(temp.right(1)=="0")
temp=temp.left(temp.size()-1);
if(temp.right(1)==".")
temp=temp.left(temp.size()-1);
resultText->setText(temp);
/*
* ,Ans
*/
if(temp.at(0) == '-')
Ans=QString("%1%2%3").arg("(").arg(temp).arg(")");
else
Ans = temp;
}
void MainWindow::onClearClicked()
{
inputText->setText("0");
historySize.clear();
calcFinished=true;
}
void MainWindow::onAnsClicked()
{
if(inputText->text()=="0"||calcFinished==true)
{
inputText->setText(Ans);
calcFinished=false;
}
else
inputText->setText(inputText->text()+Ans);
int length = Ans.size();
while(length
historySize.push(1);
}
void MainWindow::onShiftClicked()
{
/*
* shiftsin,cos,tanlg
*/
if(isShifting)
{
isShifting = false;
for(int i=0; i<4; ++i)
{
buttons[i]->setText(QString::fromStdString(BUTTONS.at(0).at(i)));
}
<API key>->setStyleSheet("QPushButton{background-color:gray;"
"font-size: 15px;"
"border-style: outset;}"
"QPushButton:hover{"
"background-color:white;"
"color: black;}"
"QPushButton:pressed{"
"background-color:rgb(0, 0, 0);"
"border-style: inset;}");
}
else
{
isShifting = true;
for(int i=0; i<4; ++i)
{
buttons[i]->setText(QString::fromStdString(SHIFT_TABLE[buttons[i]->text().toStdString()]));
}
<API key>->setStyleSheet("QPushButton:pressed{background-color:gray;"
"border-style: outset;}"
"QPushButton:hover{"
"background-color:white;"
"color: black;}"
"QPushButton{"
"font-size: 40px;"
"font-style: bold;"
"background-color:rgb(0, 0, 0);"
"border-style: inset;}");
}
}
void MainWindow::onBackspaceClicked()
{
QString result=inputText->text();
calcFinished = false;
if(result.size()==1)
{
historySize.clear();
inputText->setText("0");
calcFinished = true;
}
else
{
int length = historySize.empty() ? 1:historySize.pop();
inputText->setText(result.left(result.size()-length));
}
}
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Sep 20 14:23:56 GMT 2018
*/
package uk.ac.sanger.artemis;
import org.evosuite.runtime.annotation.<API key>;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@<API key>
public class <API key> {
@org.junit.Rule
public org.evosuite.runtime.vnet.<API key> nfr = new org.evosuite.runtime.vnet.<API key>();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void <API key>() {
org.evosuite.runtime.RuntimeSettings.className = "uk.ac.sanger.artemis.EntryChangeEvent";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.<API key> = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.<API key>();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { <API key>(); } catch(<API key> e) {}
}
@AfterClass
public static void <API key>(){
Sandbox.<API key>();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.<API key>();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.<API key>();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().<API key>();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.<API key>();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("file.encoding", "UTF-8");
java.lang.System.setProperty("java.awt.headless", "true");
java.lang.System.setProperty("java.io.tmpdir", "/var/folders/r3/<API key>/T/");
java.lang.System.setProperty("user.country", "GB");
java.lang.System.setProperty("user.dir", "/Users/kp11/workspace/applications/Artemis-build-ci/Artemis");
java.lang.System.setProperty("user.home", "/Users/kp11");
java.lang.System.setProperty("user.language", "en");
java.lang.System.setProperty("user.name", "kp11");
java.lang.System.setProperty("user.timezone", "");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(<API key>.class.getClassLoader() ,
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.Location",
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.DocumentEntry",
"uk.ac.sanger.artemis.<API key>",
"uk.ac.sanger.artemis.io.OutOfDateException",
"uk.ac.sanger.artemis.sequence.<API key>",
"uk.ac.sanger.artemis.OptionChangeEvent",
"uk.ac.sanger.artemis.FeatureSegment",
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.ComparableFeature",
"uk.ac.sanger.artemis.io.Feature",
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.StreamFeature",
"uk.ac.sanger.artemis.io.Key",
"uk.ac.sanger.artemis.sequence.<API key>",
"uk.ac.sanger.artemis.util.ReadOnlyException",
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.SimpleDocumentEntry",
"uk.ac.sanger.artemis.io.EntryInformation",
"uk.ac.sanger.artemis.EntryChangeListener",
"uk.ac.sanger.artemis.EntryChangeEvent",
"uk.ac.sanger.artemis.Entry",
"uk.ac.sanger.artemis.sequence.<API key>",
"uk.ac.sanger.artemis.sequence.AminoAcidSequence",
"uk.ac.sanger.artemis.Selectable",
"uk.ac.sanger.artemis.Feature",
"uk.ac.sanger.artemis.io.EmblDocumentEntry",
"uk.ac.sanger.artemis.io.ReadFormatException",
"uk.ac.sanger.artemis.io.DocumentFeature",
"uk.ac.sanger.artemis.io.EmblStreamFeature",
"uk.ac.sanger.artemis.io.Range",
"uk.ac.sanger.artemis.sequence.Bases",
"uk.ac.sanger.artemis.io.<API key>",
"uk.ac.sanger.artemis.io.Qualifier",
"uk.ac.sanger.artemis.io.Entry",
"uk.ac.sanger.artemis.util.StringVector",
"uk.ac.sanger.artemis.ChangeListener",
"uk.ac.sanger.artemis.<API key>",
"uk.ac.sanger.artemis.ChangeEvent",
"uk.ac.sanger.artemis.sequence.Marker",
"uk.ac.sanger.artemis.util.OutOfRangeException",
"uk.ac.sanger.artemis.util.Document",
"uk.ac.sanger.artemis.sequence.MarkerChangeEvent",
"uk.ac.sanger.artemis.io.GFFDocumentEntry",
"uk.ac.sanger.artemis.io.GFFStreamFeature",
"uk.ac.sanger.artemis.FeatureVector",
"uk.ac.sanger.artemis.io.EMBLObject",
"uk.ac.sanger.artemis.sequence.Strand",
"uk.ac.sanger.artemis.sequence.NoSequenceException",
"uk.ac.sanger.artemis.FeaturePredicate",
"uk.ac.sanger.artemis.sequence.SequenceChangeEvent",
"uk.ac.sanger.artemis.<API key>",
"uk.ac.sanger.artemis.io.QualifierVector",
"uk.ac.sanger.artemis.<API key>",
"uk.ac.sanger.artemis.util.FileDocument",
"uk.ac.sanger.artemis.FeatureChangeEvent",
"uk.ac.sanger.artemis.FeatureEnumeration",
"uk.ac.sanger.artemis.io.LineGroup"
);
}
private static void <API key>() throws <API key> {
mock(Class.forName("uk.ac.sanger.artemis.Entry", false, <API key>.class.getClassLoader()));
mock(Class.forName("uk.ac.sanger.artemis.Feature", false, <API key>.class.getClassLoader()));
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(<API key>.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"uk.ac.sanger.artemis.ChangeEvent",
"uk.ac.sanger.artemis.EntryChangeEvent",
"uk.ac.sanger.artemis.Feature",
"uk.ac.sanger.artemis.Entry"
);
}
}
|
// This file is part of Unicycler. Unicycler is free software: you can redistribute it and/or
#include "overlap_align.h"
#include "string_functions.h"
#include <seqan/align.h>
char * overlapAlignment(char * s1, char * s2,
int matchScore, int mismatchScore, int gapOpenScore, int gapExtensionScore,
int guessOverlap) {
std::string sequence1(s1);
std::string sequence2(s2);
// Trim the sequences down to a bit more than the expected overlap. This will help save time
// because the non-overlapping sequence isn't informative.
int trim_size = int((guessOverlap + 100) * 1.5);
if (trim_size < int(sequence1.length()))
sequence1 = sequence1.substr(sequence1.length() - trim_size, trim_size);
if (trim_size < int(sequence2.length()))
sequence2 = sequence2.substr(0, trim_size);
Dna5String sequenceH(sequence1);
Dna5String sequenceV(sequence2);
Align<Dna5String, ArrayGaps> alignment;
resize(rows(alignment), 2);
assignSource(row(alignment, 0), sequenceH);
assignSource(row(alignment, 1), sequenceV);
Score<int, Simple> scoringScheme(matchScore, mismatchScore, gapExtensionScore, gapOpenScore);
// The alignment configuration allows for overlap from s1 -> s2.
AlignConfig<true, false, true, false> alignConfig;
try {
globalAlignment(alignment, scoringScheme, alignConfig);
}
catch (...) {
return cppStringToCString("-1,-1");
}
std::ostringstream stream1;
stream1 << row(alignment, 0);
std::string seq1Alignment = stream1.str();
std::ostringstream stream2;
stream2 << row(alignment, 1);
std::string seq2Alignment = stream2.str();
int alignmentLength = std::max(seq1Alignment.size(), seq2Alignment.size());
if (alignmentLength == 0)
return cppStringToCString("-1,-1");
int seq1Pos = 0, seq2Pos = 0;
int seq1PosAtSeq2Start = -1, seq2PosAtSeq1End = -1;
for (int i = 0; i < alignmentLength; ++i) {
char base1 = seq1Alignment[i];
char base2 = seq2Alignment[i];
if (base1 != '-')
seq2PosAtSeq1End = seq2Pos + 1;
if (base2 != '-' && seq1PosAtSeq2Start == -1)
seq1PosAtSeq2Start = seq1Pos;
if (base1 != '-')
++seq1Pos;
if (base2 != '-')
++seq2Pos;
}
int overlap1 = seq1Pos - seq1PosAtSeq2Start;
int overlap2 = seq2PosAtSeq1End;
return cppStringToCString(std::to_string(overlap1) + "," + std::to_string(overlap2));
}
|
package me.anthonybruno.soccerSim.reader;
import org.apache.pdfbox.io.RandomAccessFile;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.text.<API key>;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.IOException;
/**
* A class that parsers team PDF files into XML files.
*/
public class TeamPdfReader {
private static final Rectangle2D.Double <API key> = new Rectangle2D.Double(0, 0, 330, 550);
private static final Rectangle2D.Double <API key> = new Rectangle2D.Double(350, 0, 350, 550);
private final File file;
public TeamPdfReader(String fileName) {
this.file = new File(fileName);
}
public TeamPdfReader(File file) {
this.file = file;
}
// public String read() { //Using IText :(
// try {
// PdfReader pdfReader = new PdfReader(file.getAbsolutePath());
// PdfDocument pdfDocument = new PdfDocument(pdfReader);
// <API key> strategy = new <API key>();
// PdfCanvasProcessor parser = new PdfCanvasProcessor(strategy);
// parser.processPageContent(pdfDocument.getFirstPage());
// return strategy.getResultantText();
// } catch (IOException e) {
// e.printStackTrace();
public void readAllTeamsToFiles() { //Using PDFBox
try {
PDFParser parser = new PDFParser(new RandomAccessFile(file, "r"));
parser.parse();
<API key> <API key> = new <API key>();
<API key>.addRegion("First", <API key>);
<API key>.addRegion("Second", <API key>);
for (int i = 0; i < parser.getPDDocument().getNumberOfPages(); i++) {
<API key>.extractRegions(parser.getPDDocument().getPage(i));
writeTeamToFile(<API key>.getTextForRegion("First"), "teams");
writeTeamToFile(<API key>.getTextForRegion("Second"), "teams");
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void writeTeamToFile(String <API key>, String saveDirectory) { //FIXME: Reduce size of method
if (<API key>.isEmpty() || !<API key>.contains(" ")) {
return; //reached a blank page
}
XmlWriter xmlWriter = new XmlWriter("UTF-8");
String text = <API key>;
if (text.indexOf('\n') < text.indexOf(' ')) {
text = text.substring(text.indexOf('\n') + 1);
}
xmlWriter.createOpenTag("team");
if (text.startsWith(" ")) {
text = text.substring(text.indexOf('\n') + 1); //need this for El Salvador
}
String name = text.substring(0, text.indexOf(" "));
text = text.substring(text.indexOf(" ") + 1);
if (!Character.isDigit(text.charAt(0))) { //handles countries with two words in name
name += " " + text.substring(0, text.indexOf(" "));
}
xmlWriter.createTagWithValue("name", name);
for (int i = 0; i < 3; i++) { //skipping stuff we don't care about
text = moveToNextLine(text);
}
text = text.substring(text.indexOf(':') + 2);
String firstHalfAttempts = text.substring(0, text.indexOf(' '));
text = text.substring(text.indexOf(' ') + 1);
String secondHalfAttempts = text.substring(0, text.indexOf('\n'));
text = moveToNextLine(text);
xmlWriter.createTagWithValue("goalRating", text.substring(text.indexOf('-') + 1, text.indexOf('\n')));
text = moveToNextLine(text);
String[] defensiveAttempts = parseHalfValues(text);
text = defensiveAttempts[0];
String <API key> = defensiveAttempts[1];
String <API key> = defensiveAttempts[2];
String[] defensiveSOG = parseHalfValues(text);
text = defensiveSOG[0];
String firstHalfSOG = defensiveSOG[1];
String secondHalfSOG = defensiveSOG[2];
xmlWriter.createTagWithValue("formation", text.substring(text.indexOf(':') + 2, text.indexOf('\n')));
text = moveToNextLine(text);
text = text.substring(text.indexOf(':') + 2);
if (text.indexOf(' ') < text.indexOf('\n')) {
xmlWriter.createTagWithValue("strategy", text.substring(0, text.indexOf(' '))); //team has fair play score
} else {
xmlWriter.createTagWithValue("strategy", text.substring(0, text.indexOf("\n")));
}
text = moveToNextLine(text);
text = moveToNextLine(text);
parseHalfStats(xmlWriter, "halfStats", firstHalfAttempts, <API key>, firstHalfSOG);
parseHalfStats(xmlWriter, "halfStats", secondHalfAttempts, <API key>, secondHalfSOG);
xmlWriter.createOpenTag("players");
while (!text.startsWith("Goalies")) {
text = parsePlayer(xmlWriter, text);
}
text = moveToNextLine(text);
parseGoalies(xmlWriter, text);
xmlWriter.createCloseTag("players");
xmlWriter.createCloseTag("team");
File saveDir = new File(saveDirectory);
try {
saveDir.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
if (!saveDir.exists()) {
file.mkdir();
}
xmlWriter.writeToFile(new File("src/main/resources/teams/" + name + ".xml"));
}
private void parseGoalies(XmlWriter xmlWriter, String text) {
while (!text.isEmpty()) {
xmlWriter.createOpenTag("goalie");
String playerName = "";
do {
playerName += text.substring(0, text.indexOf(' '));
text = text.substring(text.indexOf(' ') + 1);
} while (!isNumeric(text.substring(0, text.indexOf(' '))));
xmlWriter.createTagWithValue("name", playerName);
xmlWriter.createTagWithValue("rating", text.substring(0, text.indexOf(' ')));
text = text.substring(text.indexOf(' ') + 1);
text = text.substring(text.indexOf(' ') + 1);
text = <API key>(xmlWriter, "injury", text);
createMultiplierTag(xmlWriter, text);
text = moveToNextLine(text);
xmlWriter.createCloseTag("goalie");
}
}
private boolean isNumeric(char c) {
return isNumeric(c + "");
}
private boolean isNumeric(String string) {
return string.matches("^[-+]?\\d+$");
}
private void createMultiplierTag(XmlWriter xmlWriter, String text) {
if (text.charAt(0) != '-') {
xmlWriter.createTagWithValue("multiplier", text.charAt(1) + "");
} else {
xmlWriter.createTagWithValue("multiplier", "0");
}
}
private String parsePlayer(XmlWriter xmlWriter, String text) {
xmlWriter.createOpenTag("player");
text = parsePlayerName(xmlWriter, text);
text = <API key>(xmlWriter, "shotRange", text);
text = <API key>(xmlWriter, "goal", text);
text = <API key>(xmlWriter, "injury", text);
createMultiplierTag(xmlWriter, text);
xmlWriter.createCloseTag("player");
text = moveToNextLine(text);
return text;
}
private String parsePlayerName(XmlWriter xmlWriter, String text) {
if (isNumeric(text.charAt(text.indexOf(' ') + 1))) {
return <API key>(xmlWriter, "name", text); //Player has single name
} else {
String playerName = text.substring(0, text.indexOf(' '));
text = text.substring(text.indexOf(' ') + 1);
while (!isNumeric(text.charAt(0))) {
playerName += ' ' + text.substring(0, text.indexOf(' '));
text = text.substring(text.indexOf(' ') + 1);
}
xmlWriter.createTagWithValue("name", playerName);
return text;
}
}
private String <API key>(XmlWriter xmlWriter, String tagName, String text) {
xmlWriter.createTagWithValue(tagName, text.substring(0, text.indexOf(' ')));
text = text.substring(text.indexOf(' ') + 1);
return text;
}
private String[] parseHalfValues(String text) {
text = text.substring(text.indexOf(':') + 2);
String firstHalf = text.substring(0, text.indexOf(' '));
text = text.substring(text.indexOf(' ') + 1);
String secondHalf = text.substring(0, text.indexOf('\n'));
text = moveToNextLine(text);
return new String[]{text, firstHalf, secondHalf};
}
private void parseHalfStats(XmlWriter xmlWriter, String halfName, String attempts, String defensiveAttempts, String <API key>) {
xmlWriter.createOpenTag(halfName);
xmlWriter.createTagWithValue("attempts", attempts);
xmlWriter.createTagWithValue("defensiveAttempts", defensiveAttempts);
xmlWriter.createTagWithValue("<API key>", <API key>);
xmlWriter.createCloseTag(halfName);
}
private String moveToNextLine(String text) {
return text.substring(text.indexOf("\n") + 1);
}
public static void main(String[] args) {
TeamPdfReader teamPdfReader = new TeamPdfReader("src/main/resources/ruleFiles/Cards1.pdf");
teamPdfReader.readAllTeamsToFiles();
teamPdfReader = new TeamPdfReader("src/main/resources/ruleFiles/Cards2.pdf");
teamPdfReader.readAllTeamsToFiles();
}
}
|
module TransactionChains
class Lifetimes::ExpirationWarning < ::TransactionChain
label 'Expiration'
allow_empty
def link_chain(klass, q)
q.each do |obj|
user = if obj.is_a?(::User)
obj
elsif obj.respond_to?(:user)
obj.user
else
fail "Unable to find an owner for #{obj} of class #{klass}"
end
mail(:expiration_warning, {
params: {
object: klass.name.underscore,
state: obj.object_state,
},
user: user,
vars: {
object: obj,
state: obj.<API key>,
klass.name.underscore => obj
}
}) if user.mailer_enabled
end
end
end
end
|
InternalResource provides access to static resources in the class path.
## Related components
* [AudioResource](AudioResource.html)
* [ImageResource](ImageResource.html)
* [VideoResource](VideoResource.html)
* [WImage](WImage.html)
* [WApplication](WApplication.html)
* [WContent](WContent.html)
* [WImage](WImage.html)
* [WMultiFileWidget](WMultiFileWidget.html)
* [WTree](WTree.html)
## Further information
* [JavaDoc](../apidocs/com/github/bordertech/wcomponents/InternalResource.html);
* [List of WComponents](List-of-WComponents.html).
|
#pragma once
#include <vector>
#include <boost/thread.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/bind.hpp>
#include <boost/version.hpp>
#include <boost/function.hpp>
#include <boost/interprocess/detail/atomic.hpp>
#if (BOOST_VERSION < 104800)
using boost::interprocess::detail::atomic_inc32;
#else
using boost::interprocess::ipcdetail::atomic_inc32;
#endif
/*
* TODO:
*
* - Better documentation of API
* - deleting of ended thread:local memory
* - by mean of Done function
* - by DelThread
* - Pause/Resume function
* - use a barrier instead of a crappy sleep
* - should this code move at the end of each blocks ?
*/
namespace scheduling
{
class Scheduler;
class Thread;
class Range;
class Thread
{
public:
virtual void Init() {}
virtual void End() {}
virtual ~Thread() {};
friend class Scheduler;
friend class Range;
private:
static void Body(Thread* thread, Scheduler *scheduler);
boost::thread thread;
bool active;
};
typedef boost::function<void(Range *range)> TaskType;
class Scheduler
{
public:
Scheduler(unsigned step);
~Scheduler();
void Launch(TaskType task, unsigned b_min, unsigned b_max, unsigned force_step=0);
void Pause();
void Resume();
void Stop();
void Done();
void AddThread(Thread *thread);
void DelThread();
unsigned ThreadCount() const
{
return threads.size();
}
void <API key>();
friend class Thread;
friend class Range;
private:
enum {PAUSED, RUNNING} state;
TaskType GetTask();
bool EndTask(Thread* thread);
std::vector<Thread*> threads;
std::vector<Thread*> threads_finished;
TaskType current_task;
boost::mutex mutex;
boost::condition_variable condition;
unsigned counter;
unsigned start;
unsigned end;
unsigned current;
unsigned step;
unsigned default_step;
};
class Range
{
public:
unsigned begin()
{
return atomic_init();
}
unsigned end()
{
return ~0u;
}
unsigned next()
{
if(++current < max)
return current;
// handle pause
while (scheduler->state == Scheduler::PAUSED)
{
boost::this_thread::sleep(boost::posix_time::seconds(1));
}
return atomic_init();
}
// public for thread local data access
Thread *thread;
friend class Thread;
private:
unsigned atomic_init()
{
if(!thread->active)
return end();
unsigned new_value = scheduler->step * atomic_inc32(&scheduler->current);
if(new_value < scheduler->end)
{
max = std::min(scheduler->end, new_value + scheduler->step);
current = new_value;
return new_value;
}
return end();
}
Range(Scheduler *sched, Thread *thread_data);
unsigned current;
unsigned max;
Scheduler *scheduler;
};
}
|
// This file belongs to the "MiniCore" game engine.
// This program is free software; you can redistribute it and/or
// as published by the Free Software Foundation; either version 2
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301, USA.
#ifndef MCLOGGER_HH
#define MCLOGGER_HH
#include "mcmacros.hh"
#include <cstdio>
#include <sstream>
/*! A logging class. A MCLogger instance flushes on destruction.
*
* Example initialization:
*
* MCLogger::init("myLog.txt");
* MCLogger::enableEchoMode(true);
*
* Example logging:
*
* MCLogger().info() << "Initialization finished.";
* MCLogger().error() << "Foo happened!";
*/
class MCLogger
{
public:
//! Constructor.
MCLogger();
//! Destructor.
~MCLogger();
/*! Initialize the logger.
* \param fileName Log to fileName. Can be nullptr.
* \param append The existing log will be appended if true.
* \return false if file couldn't be opened. */
static bool init(const char * fileName, bool append = false);
//! Enable/disable echo mode.
//! \param enable Echo everything if true. Default is false.
static void enableEchoMode(bool enable);
//! Enable/disable date and time prefix.
//! \param enable Prefix with date and time if true. Default is true.
static void <API key>(bool enable);
//! Get stream to the info log message.
std::ostringstream & info();
//! Get stream to the warning log message.
std::ostringstream & warning();
//! Get stream to the error log message.
std::ostringstream & error();
//! Get stream to the fatal log message.
std::ostringstream & fatal();
private:
DISABLE_COPY(MCLogger);
DISABLE_ASSI(MCLogger);
void prefixDateTime();
static bool m_echoMode;
static bool m_dateTime;
static FILE * m_file;
std::ostringstream m_oss;
};
#endif // MCLOGGER_HH
|
// tcpconnection.cpp
// This implements RFC 793 with some changes in RFC 1122 and RFC 6298.
// Non-implemented features:
// dynamic receive window
// URG flag and urgent pointer
// delayed ACK
// queueing out-of-order TCP segments
// security/compartment
// precedence
// user timeout
// Circle - A C++ bare metal environment for Raspberry Pi
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#include <circle/net/tcpconnection.h>
#include <circle/macros.h>
#include <circle/util.h>
#include <circle/logger.h>
#include <circle/net/in.h>
#include <assert.h>
//#define TCP_DEBUG
#define TCP_MAX_CONNECTIONS 1000 // maximum number of active TCP connections
#define MSS_R 1480 // maximum segment size to be received from network layer
#define MSS_S 1480 // maximum segment size to be send to network layer
#define TCP_CONFIG_MSS (MSS_R - 20)
#define TCP_CONFIG_WINDOW (TCP_CONFIG_MSS * 10)
#define <API key> 0x10000 // should be greater than maximum send window size
#define TCP_MAX_WINDOW ((u16) -1) // without Window extension option
#define TCP_QUIET_TIME 30 // seconds after crash before another connection starts
#define HZ_TIMEWAIT (60 * HZ)
#define HZ_FIN_TIMEOUT (60 * HZ) // timeout in FIN-WAIT-2 state
#define MAX_RETRANSMISSIONS 5
struct TTCPHeader
{
u16 nSourcePort;
u16 nDestPort;
u32 nSequenceNumber;
u32 <API key>;
u16 nDataOffsetFlags; // following #define(s) are valid without BE()
#define TCP_DATA_OFFSET(field) (((field) >> 4) & 0x0F)
#define <API key> 4
//#define TCP_FLAG_NONCE (1 << 0)
//#define TCP_FLAG_CWR (1 << 15)
//#define TCP_FLAG_ECN_ECHO (1 << 14)
#define TCP_FLAG_URGENT (1 << 13)
#define TCP_FLAG_ACK (1 << 12)
#define TCP_FLAG_PUSH (1 << 11)
#define TCP_FLAG_RESET (1 << 10)
#define TCP_FLAG_SYN (1 << 9)
#define TCP_FLAG_FIN (1 << 8)
u16 nWindow;
u16 nChecksum;
u16 nUrgentPointer;
u32 Options[];
}
PACKED;
#define TCP_HEADER_SIZE 20 // valid for normal data segments without TCP options
struct TTCPOption
{
u8 nKind; // Data:
#define <API key> 0 // None (no length field)
#define TCP_OPTION_NOP 1 // None (no length field)
#define TCP_OPTION_MSS 2 // Maximum segment size (2 byte)
#define <API key> 3 // Shift count (1 byte)
#define <API key> 4 // None
#define <API key> 8 // Timestamp value, Timestamp echo reply (2*4 byte)
u8 nLength;
u8 Data[];
}
PACKED;
#define min(n, m) ((n) <= (m) ? (n) : (m))
#define max(n, m) ((n) >= (m) ? (n) : (m))
// Modulo 32 sequence number arithmetic
#define lt(x, y) ((int) ((u32) (x) - (u32) (y)) < 0)
#define le(x, y) ((int) ((u32) (x) - (u32) (y)) <= 0)
#define gt(x, y) lt (y, x)
#define ge(x, y) le (y, x)
#define bw(l, x, h) (lt ((l), (x)) && lt ((x), (h))) // between
#define bwl(l, x, h) (le ((l), (x)) && lt ((x), (h))) // low border inclusive
#define bwh(l, x, h) (lt ((l), (x)) && le ((x), (h))) // high border inclusive
#define bwlh(l, x, h) (le ((l), (x)) && le ((x), (h))) // both borders inclusive
#if !defined (NDEBUG) && defined (TCP_DEBUG)
#define NEW_STATE(state) NewState (state, __LINE__);
#else
#define NEW_STATE(state) (m_State = state)
#endif
#ifndef NDEBUG
#define UNEXPECTED_STATE() UnexpectedState (__LINE__)
#else
#define UNEXPECTED_STATE() ((void) 0)
#endif
unsigned CTCPConnection::s_nConnections = 0;
static const char FromTCP[] = "tcp";
CTCPConnection::CTCPConnection (CNetConfig *pNetConfig,
CNetworkLayer *pNetworkLayer,
CIPAddress &rForeignIP,
u16 nForeignPort,
u16 nOwnPort)
: CNetConnection (pNetConfig, pNetworkLayer, rForeignIP, nForeignPort, nOwnPort, IPPROTO_TCP),
m_bActiveOpen (TRUE),
m_State (TCPStateClosed),
m_nErrno (0),
<API key> (<API key>),
m_bRetransmit (FALSE),
m_bSendSYN (FALSE),
m_bFINQueued (FALSE),
<API key> (0),
m_bTimedOut (FALSE),
m_pTimer (CTimer::Get ()),
m_nSND_WND (TCP_CONFIG_WINDOW),
m_nSND_UP (0),
m_nRCV_NXT (0),
m_nRCV_WND (TCP_CONFIG_WINDOW),
m_nIRS (0),
m_nSND_MSS (536) // RFC 1122 section 4.2.2.6
{
s_nConnections++;
for (unsigned nTimer = TCPTimerUser; nTimer < TCPTimerUnknown; nTimer++)
{
m_hTimer[nTimer] = 0;
}
m_nISS = CalculateISN ();
m_RTOCalculator.Initialize (m_nISS);
m_nSND_UNA = m_nISS;
m_nSND_NXT = m_nISS+1;
if (SendSegment (TCP_FLAG_SYN, m_nISS))
{
m_RTOCalculator.SegmentSent (m_nISS);
NEW_STATE (TCPStateSynSent);
<API key> = MAX_RETRANSMISSIONS;
StartTimer (<API key>, m_RTOCalculator.GetRTO ());
}
}
CTCPConnection::CTCPConnection (CNetConfig *pNetConfig,
CNetworkLayer *pNetworkLayer,
u16 nOwnPort)
: CNetConnection (pNetConfig, pNetworkLayer, nOwnPort, IPPROTO_TCP),
m_bActiveOpen (FALSE),
m_State (TCPStateListen),
m_nErrno (0),
<API key> (<API key>),
m_bRetransmit (FALSE),
m_bSendSYN (FALSE),
m_bFINQueued (FALSE),
<API key> (0),
m_bTimedOut (FALSE),
m_pTimer (CTimer::Get ()),
m_nSND_WND (TCP_CONFIG_WINDOW),
m_nSND_UP (0),
m_nRCV_NXT (0),
m_nRCV_WND (TCP_CONFIG_WINDOW),
m_nIRS (0),
m_nSND_MSS (536) // RFC 1122 section 4.2.2.6
{
s_nConnections++;
for (unsigned nTimer = TCPTimerUser; nTimer < TCPTimerUnknown; nTimer++)
{
m_hTimer[nTimer] = 0;
}
}
CTCPConnection::~CTCPConnection (void)
{
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug, "Delete TCB");
#endif
assert (m_State == TCPStateClosed);
for (unsigned nTimer = TCPTimerUser; nTimer < TCPTimerUnknown; nTimer++)
{
StopTimer (nTimer);
}
// ensure no task is waiting any more
m_Event.Set ();
m_TxEvent.Set ();
assert (s_nConnections > 0);
s_nConnections
}
int CTCPConnection::Connect (void)
{
if (m_nErrno < 0)
{
return m_nErrno;
}
switch (m_State)
{
case TCPStateSynSent:
case TCPStateSynReceived:
m_Event.Clear ();
m_Event.Wait ();
break;
case TCPStateEstablished:
break;
case TCPStateListen:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
UNEXPECTED_STATE ();
// fall through
case TCPStateClosed:
return -1;
}
return m_nErrno;
}
int CTCPConnection::Accept (CIPAddress *pForeignIP, u16 *pForeignPort)
{
if (m_nErrno < 0)
{
return m_nErrno;
}
switch (m_State)
{
case TCPStateSynSent:
UNEXPECTED_STATE ();
// fall through
case TCPStateClosed:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
return -1;
case TCPStateListen:
m_Event.Clear ();
m_Event.Wait ();
break;
case TCPStateSynReceived:
case TCPStateEstablished:
break;
}
assert (pForeignIP != 0);
pForeignIP->Set (m_ForeignIP);
assert (pForeignPort != 0);
*pForeignPort = m_nForeignPort;
return m_nErrno;
}
int CTCPConnection::Close (void)
{
if (m_nErrno < 0)
{
return m_nErrno;
}
switch (m_State)
{
case TCPStateClosed:
return -1;
case TCPStateListen:
case TCPStateSynSent:
StopTimer (<API key>);
NEW_STATE (TCPStateClosed);
break;
case TCPStateSynReceived:
case TCPStateEstablished:
assert (!m_bFINQueued);
m_StateAfterFIN = TCPStateFinWait1;
<API key> = MAX_RETRANSMISSIONS;
m_bFINQueued = TRUE;
break;
case TCPStateFinWait1:
case TCPStateFinWait2:
break;
case TCPStateCloseWait:
assert (!m_bFINQueued);
m_StateAfterFIN = TCPStateLastAck; // RFC 1122 section 4.2.2.20 (a)
<API key> = MAX_RETRANSMISSIONS;
m_bFINQueued = TRUE;
break;
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
return -1;
}
if (m_nErrno < 0)
{
return m_nErrno;
}
return 0;
}
int CTCPConnection::Send (const void *pData, unsigned nLength, int nFlags)
{
if ( nFlags != 0
&& nFlags != MSG_DONTWAIT)
{
return -1;
}
if (m_nErrno < 0)
{
return m_nErrno;
}
switch (m_State)
{
case TCPStateClosed:
case TCPStateListen:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
return -1;
case TCPStateSynSent:
case TCPStateSynReceived:
case TCPStateEstablished:
case TCPStateCloseWait:
break;
}
unsigned nResult = nLength;
assert (pData != 0);
u8 *pBuffer = (u8 *) pData;
while (nLength > FRAME_BUFFER_SIZE)
{
m_TxQueue.Enqueue (pBuffer, FRAME_BUFFER_SIZE);
pBuffer += FRAME_BUFFER_SIZE;
nLength -= FRAME_BUFFER_SIZE;
}
if (nLength > 0)
{
m_TxQueue.Enqueue (pBuffer, nLength);
}
if (!(nFlags & MSG_DONTWAIT))
{
m_TxEvent.Clear ();
m_TxEvent.Wait ();
if (m_nErrno < 0)
{
return m_nErrno;
}
}
return nResult;
}
int CTCPConnection::Receive (void *pBuffer, int nFlags)
{
if ( nFlags != 0
&& nFlags != MSG_DONTWAIT)
{
return -1;
}
if (m_nErrno < 0)
{
return m_nErrno;
}
unsigned nLength;
while ((nLength = m_RxQueue.Dequeue (pBuffer)) == 0)
{
switch (m_State)
{
case TCPStateClosed:
case TCPStateListen:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
return -1;
case TCPStateSynSent:
case TCPStateSynReceived:
case TCPStateEstablished:
break;
}
if (nFlags & MSG_DONTWAIT)
{
return 0;
}
m_Event.Clear ();
m_Event.Wait ();
if (m_nErrno < 0)
{
return m_nErrno;
}
}
return nLength;
}
int CTCPConnection::SendTo (const void *pData, unsigned nLength, int nFlags,
CIPAddress &rForeignIP, u16 nForeignPort)
{
// ignore rForeignIP and nForeignPort
return Send (pData, nLength, nFlags);
}
int CTCPConnection::ReceiveFrom (void *pBuffer, int nFlags, CIPAddress *pForeignIP, u16 *pForeignPort)
{
int nResult = Receive (pBuffer, nFlags);
if (nResult <= 0)
{
return nResult;
}
if ( pForeignIP != 0
&& pForeignPort != 0)
{
pForeignIP->Set (m_ForeignIP);
*pForeignPort = m_nForeignPort;
}
return 0;
}
int CTCPConnection::SetOptionBroadcast (boolean bAllowed)
{
return 0;
}
boolean CTCPConnection::IsConnected (void) const
{
return m_State > TCPStateSynSent
&& m_State != TCPStateTimeWait;
}
boolean CTCPConnection::IsTerminated (void) const
{
return m_State == TCPStateClosed;
}
void CTCPConnection::Process (void)
{
if (m_bTimedOut)
{
m_nErrno = -1;
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return;
}
switch (m_State)
{
case TCPStateClosed:
case TCPStateListen:
case TCPStateFinWait2:
case TCPStateTimeWait:
return;
case TCPStateSynSent:
case TCPStateSynReceived:
if (m_bSendSYN)
{
m_bSendSYN = FALSE;
if (m_State == TCPStateSynSent)
{
SendSegment (TCP_FLAG_SYN, m_nISS);
}
else
{
SendSegment (TCP_FLAG_SYN | TCP_FLAG_ACK, m_nISS, m_nRCV_NXT);
}
m_RTOCalculator.SegmentSent (m_nISS);
StartTimer (<API key>, m_RTOCalculator.GetRTO ());
}
return;
case TCPStateEstablished:
case TCPStateFinWait1:
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
if ( <API key>.IsEmpty ()
&& m_TxQueue.IsEmpty ()
&& m_bFINQueued)
{
SendSegment (TCP_FLAG_FIN | TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
m_RTOCalculator.SegmentSent (m_nSND_NXT);
m_nSND_NXT++;
NEW_STATE (m_StateAfterFIN);
m_bFINQueued = FALSE;
StartTimer (<API key>, m_RTOCalculator.GetRTO ());
}
break;
}
u8 TempBuffer[FRAME_BUFFER_SIZE];
unsigned nLength;
while ( <API key>.GetFreeSpace () >= FRAME_BUFFER_SIZE
&& (nLength = m_TxQueue.Dequeue (TempBuffer)) > 0)
{
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug, "Transfering %u bytes into RT buffer", nLength);
#endif
<API key>.Write (TempBuffer, nLength);
}
// pacing transmit
if ( ( m_State == TCPStateEstablished
|| m_State == TCPStateCloseWait)
&& m_TxQueue.IsEmpty ())
{
m_TxEvent.Set ();
}
if (m_bRetransmit)
{
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug, "Retransmission (nxt %u, una %u)", m_nSND_NXT-m_nISS, m_nSND_UNA-m_nISS);
#endif
m_bRetransmit = FALSE;
<API key>.Reset ();
m_nSND_NXT = m_nSND_UNA;
}
u32 nBytesAvail;
u32 nWindowLeft;
while ( (nBytesAvail = <API key>.GetBytesAvailable ()) > 0
&& (nWindowLeft = m_nSND_UNA+<API key>) > 0)
{
nLength = min (nBytesAvail, nWindowLeft);
nLength = min (nLength, m_nSND_MSS);
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug, "Transfering %u bytes into TX buffer", nLength);
#endif
assert (nLength <= FRAME_BUFFER_SIZE);
<API key>.Read (TempBuffer, nLength);
unsigned nFlags = TCP_FLAG_ACK;
if (m_TxQueue.IsEmpty ())
{
nFlags |= TCP_FLAG_PUSH;
}
SendSegment (nFlags, m_nSND_NXT, m_nRCV_NXT, TempBuffer, nLength);
m_RTOCalculator.SegmentSent (m_nSND_NXT, nLength);
m_nSND_NXT += nLength;
StartTimer (<API key>, m_RTOCalculator.GetRTO ());
}
}
int CTCPConnection::PacketReceived (const void *pPacket,
unsigned nLength,
CIPAddress &rSenderIP,
CIPAddress &rReceiverIP,
int nProtocol)
{
if (nProtocol != IPPROTO_TCP)
{
return 0;
}
if (nLength < sizeof (TTCPHeader))
{
return -1;
}
assert (pPacket != 0);
TTCPHeader *pHeader = (TTCPHeader *) pPacket;
if (m_nOwnPort != be2le16 (pHeader->nDestPort))
{
return 0;
}
if (m_State != TCPStateListen)
{
if ( m_ForeignIP != rSenderIP
|| m_nForeignPort != be2le16 (pHeader->nSourcePort))
{
return 0;
}
}
else
{
if (!(pHeader->nDataOffsetFlags & TCP_FLAG_SYN))
{
return 0;
}
m_Checksum.<API key> (rSenderIP);
}
if (m_Checksum.Calculate (pPacket, nLength) != CHECKSUM_OK)
{
return 0;
}
u16 nFlags = pHeader->nDataOffsetFlags;
u32 nDataOffset = TCP_DATA_OFFSET (pHeader->nDataOffsetFlags)*4;
u32 nDataLength = nLength-nDataOffset;
// Current Segment Variables
u32 nSEG_SEQ = be2le32 (pHeader->nSequenceNumber);
u32 nSEG_ACK = be2le32 (pHeader-><API key>);
u32 nSEG_LEN = nDataLength;
if (nFlags & TCP_FLAG_SYN)
{
nSEG_LEN++;
}
if (nFlags & TCP_FLAG_FIN)
{
nSEG_LEN++;
}
u32 nSEG_WND = be2le16 (pHeader->nWindow);
//u16 nSEG_UP = be2le16 (pHeader->nUrgentPointer);
//u32 nSEG_PRC; // segment precedence value
ScanOptions (pHeader);
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug,
"rx %c%c%c%c%c%c, seq %u, ack %u, win %u, len %u",
nFlags & TCP_FLAG_URGENT ? 'U' : '-',
nFlags & TCP_FLAG_ACK ? 'A' : '-',
nFlags & TCP_FLAG_PUSH ? 'P' : '-',
nFlags & TCP_FLAG_RESET ? 'R' : '-',
nFlags & TCP_FLAG_SYN ? 'S' : '-',
nFlags & TCP_FLAG_FIN ? 'F' : '-',
nSEG_SEQ-m_nIRS,
nFlags & TCP_FLAG_ACK ? nSEG_ACK-m_nISS : 0,
nSEG_WND,
nDataLength);
DumpStatus ();
#endif
boolean bAcceptable = FALSE;
// RFC 793 section 3.9 "SEGMENT ARRIVES"
switch (m_State)
{
case TCPStateClosed:
if (nFlags & TCP_FLAG_RESET)
{
// ignore
}
else if (!(nFlags & TCP_FLAG_ACK))
{
m_ForeignIP.Set (rSenderIP);
m_nForeignPort = be2le16 (pHeader->nSourcePort);
m_Checksum.<API key> (rSenderIP);
SendSegment (TCP_FLAG_RESET | TCP_FLAG_ACK, 0, nSEG_SEQ+nSEG_LEN);
}
else
{
m_ForeignIP.Set (rSenderIP);
m_nForeignPort = be2le16 (pHeader->nSourcePort);
m_Checksum.<API key> (rSenderIP);
SendSegment (TCP_FLAG_RESET, nSEG_ACK);
}
break;
case TCPStateListen:
if (nFlags & TCP_FLAG_RESET)
{
// ignore
}
else if (nFlags & TCP_FLAG_ACK)
{
m_ForeignIP.Set (rSenderIP);
m_nForeignPort = be2le16 (pHeader->nSourcePort);
m_Checksum.<API key> (rSenderIP);
SendSegment (TCP_FLAG_RESET, nSEG_ACK);
}
else if (nFlags & TCP_FLAG_SYN)
{
if (s_nConnections >= TCP_MAX_CONNECTIONS)
{
m_ForeignIP.Set (rSenderIP);
m_nForeignPort = be2le16 (pHeader->nSourcePort);
m_Checksum.<API key> (rSenderIP);
SendSegment (TCP_FLAG_RESET | TCP_FLAG_ACK, 0, nSEG_SEQ+nSEG_LEN);
break;
}
m_nRCV_NXT = nSEG_SEQ+1;
m_nIRS = nSEG_SEQ;
m_nSND_WND = nSEG_WND;
m_nSND_WL1 = nSEG_SEQ;
m_nSND_WL2 = nSEG_ACK;
assert (nSEG_LEN > 0);
if (nDataLength > 0)
{
m_RxQueue.Enqueue ((u8 *) pPacket+nDataOffset, nDataLength);
}
m_nISS = CalculateISN ();
m_RTOCalculator.Initialize (m_nISS);
m_ForeignIP.Set (rSenderIP);
m_nForeignPort = be2le16 (pHeader->nSourcePort);
m_Checksum.<API key> (rSenderIP);
SendSegment (TCP_FLAG_SYN | TCP_FLAG_ACK, m_nISS, m_nRCV_NXT);
m_RTOCalculator.SegmentSent (m_nISS);
m_nSND_NXT = m_nISS+1;
m_nSND_UNA = m_nISS;
NEW_STATE (TCPStateSynReceived);
m_Event.Set ();
}
break;
case TCPStateSynSent:
if (nFlags & TCP_FLAG_ACK)
{
if (!bwh (m_nISS, nSEG_ACK, m_nSND_NXT))
{
if (!(nFlags & TCP_FLAG_RESET))
{
SendSegment (TCP_FLAG_RESET, nSEG_ACK);
}
return 1;
}
else if (bwlh (m_nSND_UNA, nSEG_ACK, m_nSND_NXT))
{
bAcceptable = TRUE;
}
}
if (nFlags & TCP_FLAG_RESET)
{
if (bAcceptable)
{
NEW_STATE (TCPStateClosed);
m_bSendSYN = FALSE;
m_nErrno = -1;
m_Event.Set ();
}
break;
}
if ( (nFlags & TCP_FLAG_ACK)
&& !bAcceptable)
{
break;
}
if (nFlags & TCP_FLAG_SYN)
{
m_nRCV_NXT = nSEG_SEQ+1;
m_nIRS = nSEG_SEQ;
if (nFlags & TCP_FLAG_ACK)
{
m_RTOCalculator.SegmentAcknowledged (nSEG_ACK);
if (nSEG_ACK-m_nSND_UNA > 1)
{
<API key>.Advance (<API key>);
}
m_nSND_UNA = nSEG_ACK;
}
if (gt (m_nSND_UNA, m_nISS))
{
NEW_STATE (TCPStateEstablished);
m_bSendSYN = FALSE;
StopTimer (<API key>);
// next transmission starts with this count
<API key> = MAX_RETRANSMISSIONS;
m_Event.Set ();
m_nSND_WND = nSEG_WND;
m_nSND_WL1 = nSEG_SEQ;
m_nSND_WL2 = nSEG_ACK;
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
if ( (nFlags & TCP_FLAG_FIN) // other controls?
|| nDataLength > 0)
{
goto StepSix;
}
break;
}
else
{
NEW_STATE (TCPStateSynReceived);
m_bSendSYN = FALSE;
SendSegment (TCP_FLAG_SYN | TCP_FLAG_ACK, m_nISS, m_nRCV_NXT);
m_RTOCalculator.SegmentSent (m_nISS);
<API key> = MAX_RETRANSMISSIONS;
StartTimer (<API key>, m_RTOCalculator.GetRTO ());
if ( (nFlags & TCP_FLAG_FIN) // other controls?
|| nDataLength > 0)
{
if (nFlags & TCP_FLAG_FIN)
{
SendSegment (TCP_FLAG_RESET, m_nSND_NXT);
NEW_STATE (TCPStateClosed);
m_nErrno = -1;
m_Event.Set ();
}
if (nDataLength > 0)
{
m_RxQueue.Enqueue ((u8 *) pPacket+nDataOffset, nDataLength);
}
break;
}
}
}
break;
case TCPStateSynReceived:
case TCPStateEstablished:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
// step 1 ( check sequence number)
if (m_nRCV_WND > 0)
{
if (nSEG_LEN == 0)
{
if (bwl (m_nRCV_NXT, nSEG_SEQ, m_nRCV_NXT+m_nRCV_WND))
{
bAcceptable = TRUE;
}
}
else
{
if ( bwl (m_nRCV_NXT, nSEG_SEQ, m_nRCV_NXT+m_nRCV_WND)
|| bwl (m_nRCV_NXT, nSEG_SEQ+nSEG_LEN-1, m_nRCV_NXT+m_nRCV_WND))
{
bAcceptable = TRUE;
}
}
}
else
{
if (nSEG_LEN == 0)
{
if (nSEG_SEQ == m_nRCV_NXT)
{
bAcceptable = TRUE;
}
}
}
if ( !bAcceptable
&& m_State != TCPStateSynReceived)
{
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
break;
}
// step 2 (check RST bit)
if (nFlags & TCP_FLAG_RESET)
{
switch (m_State)
{
case TCPStateSynReceived:
<API key>.Flush ();
if (!m_bActiveOpen)
{
NEW_STATE (TCPStateListen);
return 1;
}
else
{
m_nErrno = -1;
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return 1;
}
break;
case TCPStateEstablished:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
m_nErrno = -1;
<API key>.Flush ();
m_TxQueue.Flush ();
m_RxQueue.Flush ();
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return 1;
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return 1;
default:
UNEXPECTED_STATE ();
return 1;
}
}
// step 3 (check security and precedence, not supported)
// step 4 (check SYN bit)
if (nFlags & TCP_FLAG_SYN)
{
// RFC 1122 section 4.2.2.20 (e)
if ( m_State == TCPStateSynReceived
&& !m_bActiveOpen)
{
NEW_STATE (TCPStateListen);
return 1;
}
SendSegment (TCP_FLAG_RESET, m_nSND_NXT);
m_nErrno = -1;
<API key>.Flush ();
m_TxQueue.Flush ();
m_RxQueue.Flush ();
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return 1;
}
// step 5 (check ACK field)
if (!(nFlags & TCP_FLAG_ACK))
{
return 1;
}
switch (m_State)
{
case TCPStateSynReceived:
if (bwlh (m_nSND_UNA, nSEG_ACK, m_nSND_NXT))
{
// RFC 1122 section 4.2.2.20 (f)
m_nSND_WND = nSEG_WND;
m_nSND_WL1 = nSEG_SEQ;
m_nSND_WL2 = nSEG_ACK;
m_nSND_UNA = nSEG_ACK; // got ACK for SYN
m_RTOCalculator.SegmentAcknowledged (nSEG_ACK);
NEW_STATE (TCPStateEstablished);
// next transmission starts with this count
<API key> = MAX_RETRANSMISSIONS;
}
else
{
SendSegment (TCP_FLAG_RESET, nSEG_ACK);
}
break;
case TCPStateEstablished:
case TCPStateFinWait1:
case TCPStateFinWait2:
case TCPStateCloseWait:
case TCPStateClosing:
if (bwh (m_nSND_UNA, nSEG_ACK, m_nSND_NXT))
{
m_RTOCalculator.SegmentAcknowledged (nSEG_ACK);
unsigned nBytesAck = nSEG_ACK-m_nSND_UNA;
m_nSND_UNA = nSEG_ACK;
if (nSEG_ACK == m_nSND_NXT) // all segments are acknowledged
{
StopTimer (<API key>);
// next transmission starts with this count
<API key> = MAX_RETRANSMISSIONS;
}
if ( m_State == TCPStateFinWait1
|| m_State == TCPStateClosing)
{
nBytesAck--; // acknowledged FIN does not count
m_bFINQueued = FALSE;
}
if ( m_State == TCPStateEstablished
&& nBytesAck == 1)
{
nBytesAck
}
if (nBytesAck > 0)
{
<API key>.Advance (nBytesAck);
}
// update send window
if ( lt (m_nSND_WL1, nSEG_SEQ)
|| ( m_nSND_WL1 == nSEG_SEQ
&& le (m_nSND_WL2, nSEG_ACK)))
{
m_nSND_WND = nSEG_WND;
m_nSND_WL1 = nSEG_SEQ;
m_nSND_WL2 = nSEG_ACK;
}
}
else if (le (nSEG_ACK, m_nSND_UNA)) // RFC 1122 section 4.2.2.20 (g)
{
// ignore duplicate ACK ...
// RFC 1122 section 4.2.2.20 (g)
if (bwlh (m_nSND_UNA, nSEG_ACK, m_nSND_NXT))
{
// ... but update send window
if ( lt (m_nSND_WL1, nSEG_SEQ)
|| ( m_nSND_WL1 == nSEG_SEQ
&& le (m_nSND_WL2, nSEG_ACK)))
{
m_nSND_WND = nSEG_WND;
m_nSND_WL1 = nSEG_SEQ;
m_nSND_WL2 = nSEG_ACK;
}
}
}
else if (gt (nSEG_ACK, m_nSND_NXT))
{
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
return 1;
}
switch (m_State)
{
case TCPStateEstablished:
case TCPStateCloseWait:
break;
case TCPStateFinWait1:
if (nSEG_ACK == m_nSND_NXT) // if our FIN is now acknowledged
{
m_RTOCalculator.SegmentAcknowledged (nSEG_ACK);
m_bFINQueued = FALSE;
StopTimer (<API key>);
NEW_STATE (TCPStateFinWait2);
StartTimer (TCPTimerTimeWait, HZ_FIN_TIMEOUT);
}
else
{
break;
}
// fall through
case TCPStateFinWait2:
if (<API key>.IsEmpty ())
{
m_Event.Set ();
}
break;
case TCPStateClosing:
if (nSEG_ACK == m_nSND_NXT) // if our FIN is now acknowledged
{
m_RTOCalculator.SegmentAcknowledged (nSEG_ACK);
m_bFINQueued = FALSE;
StopTimer (<API key>);
NEW_STATE (TCPStateTimeWait);
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
}
break;
default:
UNEXPECTED_STATE ();
break;
}
break;
case TCPStateLastAck:
if (nSEG_ACK == m_nSND_NXT) // if our FIN is now acknowledged
{
m_bFINQueued = FALSE;
NEW_STATE (TCPStateClosed);
m_Event.Set ();
return 1;
}
break;
case TCPStateTimeWait:
if (nSEG_ACK == m_nSND_NXT) // if our FIN is now acknowledged
{
m_bFINQueued = FALSE;
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
}
break;
default:
UNEXPECTED_STATE ();
break;
}
// step 6 (check URG bit, not supported)
StepSix:
// step 7 (process text segment)
if (nSEG_LEN == 0)
{
return 1;
}
switch (m_State)
{
case TCPStateEstablished:
case TCPStateFinWait1:
case TCPStateFinWait2:
if (nSEG_SEQ == m_nRCV_NXT)
{
if (nDataLength > 0)
{
m_RxQueue.Enqueue ((u8 *) pPacket+nDataOffset, nDataLength);
m_nRCV_NXT += nDataLength;
// m_nRCV_WND should be adjusted here (section 3.7)
// following ACK could be piggybacked with data
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
if (nFlags & TCP_FLAG_PUSH)
{
m_Event.Set ();
}
}
}
else
{
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
return 1;
}
break;
case TCPStateSynReceived: // this state not in RFC 793
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
case TCPStateTimeWait:
break;
default:
UNEXPECTED_STATE ();
break;
}
// step 8 (check FIN bit)
if ( m_State == TCPStateClosed
|| m_State == TCPStateListen
|| m_State == TCPStateSynSent)
{
return 1;
}
if (!(nFlags & TCP_FLAG_FIN))
{
return 1;
}
// connection is closing
m_nRCV_NXT++;
SendSegment (TCP_FLAG_ACK, m_nSND_NXT, m_nRCV_NXT);
switch (m_State)
{
case TCPStateSynReceived:
case TCPStateEstablished:
NEW_STATE (TCPStateCloseWait);
m_Event.Set ();
break;
case TCPStateFinWait1:
if (nSEG_ACK == m_nSND_NXT) // if our FIN is now acknowledged
{
m_bFINQueued = FALSE;
StopTimer (<API key>);
StopTimer (TCPTimerUser);
NEW_STATE (TCPStateTimeWait);
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
}
else
{
NEW_STATE (TCPStateClosing);
}
break;
case TCPStateFinWait2:
StopTimer (<API key>);
StopTimer (TCPTimerUser);
NEW_STATE (TCPStateTimeWait);
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
break;
case TCPStateCloseWait:
case TCPStateClosing:
case TCPStateLastAck:
break;
case TCPStateTimeWait:
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
break;
default:
UNEXPECTED_STATE ();
break;
}
break;
}
return 1;
}
int CTCPConnection::<API key> (<API key> Type,
CIPAddress &rSenderIP,
CIPAddress &rReceiverIP,
u16 nSendPort,
u16 nReceivePort,
int nProtocol)
{
if (nProtocol != IPPROTO_TCP)
{
return 0;
}
if (m_State < TCPStateSynSent)
{
return 0;
}
if ( m_ForeignIP != rSenderIP
|| m_nForeignPort != nSendPort)
{
return 0;
}
assert (m_pNetConfig != 0);
if ( rReceiverIP != *m_pNetConfig->GetIPAddress ()
|| m_nOwnPort != nReceivePort)
{
return 0;
}
m_nErrno = -1;
StopTimer (<API key>);
NEW_STATE (TCPStateTimeWait);
StartTimer (TCPTimerTimeWait, HZ_TIMEWAIT);
m_Event.Set ();
return 1;
}
boolean CTCPConnection::SendSegment (unsigned nFlags, u32 nSequenceNumber, u32 <API key>,
const void *pData, unsigned nDataLength)
{
unsigned nDataOffset = 5;
assert (nDataOffset * 4 == sizeof (TTCPHeader));
if (nFlags & TCP_FLAG_SYN)
{
nDataOffset++;
}
unsigned nHeaderLength = nDataOffset * 4;
unsigned nPacketLength = nHeaderLength + nDataLength; // may wrap
assert (nPacketLength >= nHeaderLength);
assert (nHeaderLength <= FRAME_BUFFER_SIZE);
u8 TxBuffer[FRAME_BUFFER_SIZE];
TTCPHeader *pHeader = (TTCPHeader *) TxBuffer;
pHeader->nSourcePort = le2be16 (m_nOwnPort);
pHeader->nDestPort = le2be16 (m_nForeignPort);
pHeader->nSequenceNumber = le2be32 (nSequenceNumber);
pHeader-><API key> = nFlags & TCP_FLAG_ACK ? le2be32 (<API key>) : 0;
pHeader->nDataOffsetFlags = (nDataOffset << <API key>) | nFlags;
pHeader->nWindow = le2be16 (m_nRCV_WND);
pHeader->nUrgentPointer = le2be16 (m_nSND_UP);
if (nFlags & TCP_FLAG_SYN)
{
TTCPOption *pOption = (TTCPOption *) pHeader->Options;
pOption->nKind = TCP_OPTION_MSS;
pOption->nLength = 4;
pOption->Data[0] = TCP_CONFIG_MSS >> 8;
pOption->Data[1] = TCP_CONFIG_MSS & 0xFF;
}
if (nDataLength > 0)
{
assert (pData != 0);
memcpy (TxBuffer+nHeaderLength, pData, nDataLength);
}
pHeader->nChecksum = 0; // must be 0 for calculation
pHeader->nChecksum = m_Checksum.Calculate (TxBuffer, nPacketLength);
#ifdef TCP_DEBUG
CLogger::Get ()->Write (FromTCP, LogDebug,
"tx %c%c%c%c%c%c, seq %u, ack %u, win %u, len %u",
nFlags & TCP_FLAG_URGENT ? 'U' : '-',
nFlags & TCP_FLAG_ACK ? 'A' : '-',
nFlags & TCP_FLAG_PUSH ? 'P' : '-',
nFlags & TCP_FLAG_RESET ? 'R' : '-',
nFlags & TCP_FLAG_SYN ? 'S' : '-',
nFlags & TCP_FLAG_FIN ? 'F' : '-',
<API key>,
nFlags & TCP_FLAG_ACK ? <API key> : 0,
m_nRCV_WND,
nDataLength);
#endif
assert (m_pNetworkLayer != 0);
return m_pNetworkLayer->Send (m_ForeignIP, TxBuffer, nPacketLength, IPPROTO_TCP);
}
void CTCPConnection::ScanOptions (TTCPHeader *pHeader)
{
assert (pHeader != 0);
unsigned nDataOffset = TCP_DATA_OFFSET (pHeader->nDataOffsetFlags)*4;
u8 *pHeaderEnd = (u8 *) pHeader+nDataOffset;
TTCPOption *pOption = (TTCPOption *) pHeader->Options;
while ((u8 *) pOption+2 <= pHeaderEnd)
{
switch (pOption->nKind)
{
case <API key>:
return;
case TCP_OPTION_NOP:
pOption = (TTCPOption *) ((u8 *) pOption+1);
break;
case TCP_OPTION_MSS:
if ( pOption->nLength == 4
&& (u8 *) pOption+4 <= pHeaderEnd)
{
u32 nMSS = (u16) pOption->Data[0] << 8 | pOption->Data[1];
// RFC 1122 section 4.2.2.6
nMSS = min (nMSS+20, MSS_S) - TCP_HEADER_SIZE - IP_OPTION_SIZE;
if (nMSS >= 10) // self provided sanity check
{
m_nSND_MSS = (u16) nMSS;
}
}
// fall through
default:
pOption = (TTCPOption *) ((u8 *) pOption+pOption->nLength);
break;
}
}
}
u32 CTCPConnection::CalculateISN (void)
{
assert (m_pTimer != 0);
return ( m_pTimer->GetTime () * HZ
+ m_pTimer->GetTicks () % HZ)
* (TCP_MAX_WINDOW / TCP_QUIET_TIME / HZ);
}
void CTCPConnection::StartTimer (unsigned nTimer, unsigned nHZ)
{
assert (nTimer < TCPTimerUnknown);
assert (nHZ > 0);
assert (m_pTimer != 0);
StopTimer (nTimer);
m_hTimer[nTimer] = m_pTimer->StartKernelTimer (nHZ, TimerStub, (void *) (uintptr) nTimer, this);
}
void CTCPConnection::StopTimer (unsigned nTimer)
{
assert (nTimer < TCPTimerUnknown);
assert (m_pTimer != 0);
m_TimerSpinLock.Acquire ();
if (m_hTimer[nTimer] != 0)
{
m_pTimer->CancelKernelTimer (m_hTimer[nTimer]);
m_hTimer[nTimer] = 0;
}
m_TimerSpinLock.Release ();
}
void CTCPConnection::TimerHandler (unsigned nTimer)
{
assert (nTimer < TCPTimerUnknown);
m_TimerSpinLock.Acquire ();
if (m_hTimer[nTimer] == 0) // timer was stopped in the meantime
{
m_TimerSpinLock.Release ();
return;
}
m_hTimer[nTimer] = 0;
m_TimerSpinLock.Release ();
switch (nTimer)
{
case <API key>:
m_RTOCalculator.<API key> ();
if (<API key>
{
m_bTimedOut = TRUE;
break;
}
switch (m_State)
{
case TCPStateClosed:
case TCPStateListen:
case TCPStateFinWait2:
case TCPStateTimeWait:
UNEXPECTED_STATE ();
break;
case TCPStateSynSent:
case TCPStateSynReceived:
assert (!m_bSendSYN);
m_bSendSYN = TRUE;
break;
case TCPStateEstablished:
case TCPStateCloseWait:
assert (!m_bRetransmit);
m_bRetransmit = TRUE;
break;
case TCPStateFinWait1:
case TCPStateClosing:
case TCPStateLastAck:
assert (!m_bFINQueued);
m_bFINQueued = TRUE;
break;
}
break;
case TCPTimerTimeWait:
NEW_STATE (TCPStateClosed);
break;
case TCPTimerUser:
case TCPTimerUnknown:
assert (0);
break;
}
}
void CTCPConnection::TimerStub (TKernelTimerHandle hTimer, void *pParam, void *pContext)
{
CTCPConnection *pThis = (CTCPConnection *) pContext;
assert (pThis != 0);
unsigned nTimer = (unsigned) (uintptr) pParam;
assert (nTimer < TCPTimerUnknown);
pThis->TimerHandler (nTimer);
}
#ifndef NDEBUG
void CTCPConnection::DumpStatus (void)
{
CLogger::Get ()->Write (FromTCP, LogDebug,
"sta %u, una %u, snx %u, swn %u, rnx %u, rwn %u, fprt %u",
m_State,
m_nSND_UNA-m_nISS,
m_nSND_NXT-m_nISS,
m_nSND_WND,
m_nRCV_NXT-m_nIRS,
m_nRCV_WND,
(unsigned) m_nForeignPort);
}
TTCPState CTCPConnection::NewState (TTCPState State, unsigned nLine)
{
const static char *StateName[] = // must match TTCPState
{
"CLOSED",
"LISTEN",
"SYN-SENT",
"SYN-RECEIVED",
"ESTABLISHED",
"FIN-WAIT-1",
"FIN-WAIT-2",
"CLOSE-WAIT",
"CLOSING",
"LAST-ACK",
"TIME-WAIT"
};
assert (m_State < sizeof StateName / sizeof StateName[0]);
assert (State < sizeof StateName / sizeof StateName[0]);
CLogger::Get ()->Write (FromTCP, LogDebug, "State %s -> %s at line %u", StateName[m_State], StateName[State], nLine);
return m_State = State;
}
void CTCPConnection::UnexpectedState (unsigned nLine)
{
DumpStatus ();
CLogger::Get ()->Write (FromTCP, LogPanic, "Unexpected state %u at line %u", m_State, nLine);
}
#endif
|
# Controller generated by Typus, use it to extend admin functionality.
class Admin::<API key> < Admin::MasterController
=begin
# You can overwrite and extend Admin::MasterController with your methods.
# Actions have to be defined in <tt>config/typus/application.yml</tt>:
# UserInterest:
# actions:
# index: custom_action
# edit: <API key>
# to have access to them.
# admin:
# UserInterest: create, read, update, destroy, custom_action
# editor:
# UserInterest: create, read, update, <API key>
def index
end
def custom_action
end
def <API key>
end
=end
end
|
#include "template_components.h"
#include <QtGui/QSpacerItem>
TemplateComponents::TemplateComponents(const QSharedPointer<const Template>& templ,
QWidget *parent)
: QWidget(parent), templ(templ)
{
ui.setupUi(this);
QList<FoodComponent> components = templ->getComponents();
for (QList<FoodComponent>::iterator i = components.begin(); i != components.end(); ++i)
{
<API key>.append(<API key>(i->getFoodAmount(), this));
}
ui.componentLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding),
ui.componentLayout->rowCount(), 0);
}
TemplateComponents::~TemplateComponents()
{
}
QSharedPointer<FoodCollection> TemplateComponents::getCollection() const
{
QSharedPointer<FoodCollection> collection = FoodCollection::<API key>(templ->getDisplayName());
for (QList<<API key>>::const_iterator i = <API key>.begin();
i != <API key>.end(); ++i)
{
collection->addComponent(i->getFoodAmount());
}
return collection;
}
TemplateComponents::<API key>::<API key>
(FoodAmount foodAmount, TemplateComponents* parent)
: food(foodAmount.getFood()), lblFoodName(new QLabel(parent)),
txtAmount(new QLineEdit(parent)), cbUnit(new QComboBox(parent)),
chkIncludeRefuse(new QCheckBox(parent))
{
int row = parent->ui.componentLayout->rowCount();
parent->ui.componentLayout->addWidget(lblFoodName, row, 0);
parent->ui.componentLayout->addWidget(txtAmount, row, 1);
parent->ui.componentLayout->addWidget(cbUnit, row, 2);
parent->ui.componentLayout->addWidget(chkIncludeRefuse, row, 3);
lblFoodName->setText(food->getDisplayName());
lblFoodName->setWordWrap(true);
txtAmount->setText(QString::number(foodAmount.getAmount()));
txtAmount->setMinimumWidth(50);
txtAmount->setMaximumWidth(80);
txtAmount->setAlignment(Qt::AlignRight);
QMap<QString, QSharedPointer<const Unit> > unitsToShow;
QList<Unit::Dimensions::Dimension> validDimensions = food->getValidDimensions();
for (QList<Unit::Dimensions::Dimension>::const_iterator i = validDimensions.begin();
i != validDimensions.end(); ++i)
{
QVector<QSharedPointer<const Unit> > units = Unit::getAllUnits(*i);
for (QVector<QSharedPointer<const Unit> >::const_iterator i = units.begin();
i != units.end(); ++i)
{
unitsToShow.insert((*i)->getName(), *i);
}
}
for (QMap<QString, QSharedPointer<const Unit> >::iterator i = unitsToShow.begin();
i != unitsToShow.end(); ++i)
{
cbUnit->addItem(i.value()-><API key>(),
i.value()->getAbbreviation());
}
cbUnit->setCurrentIndex(cbUnit->findData(foodAmount.getUnit()->getAbbreviation()));
chkIncludeRefuse->setText("Including inedible parts");
chkIncludeRefuse->setChecked
(foodAmount.includesRefuse() && foodAmount.getFood()->getPercentRefuse() > 0);
chkIncludeRefuse->setEnabled(foodAmount.getFood()->getPercentRefuse() > 0);
}
FoodAmount TemplateComponents::<API key>::getFoodAmount() const
{
return FoodAmount(food, txtAmount->text().toDouble(),
Unit::getUnit(cbUnit->itemData(cbUnit->currentIndex()).toString()),
!chkIncludeRefuse->isEnabled() || chkIncludeRefuse->isChecked());
}
|
#define BOOST_TEST_MODULE segmentize tests
#include <boost/test/unit_test.hpp>
#include <ostream>
#include "segmentize.hpp"
#include "bg_operators.hpp"
using namespace std;
<API key>(segmentize_tests)
void print_result(const vector<std::pair<linestring_type_fp, bool>>& result) {
cout << result;
}
<API key>(abuts) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{0,0}, {2,2}}, true},
{{{1,1}, {2,0}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 3UL);
}
<API key>(x_shape) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{0,10000}, {10000,9000}}, true},
{{{10000,10000}, {0,0}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 4UL);
}
<API key>(plus_shape) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{1,2}, {3,2}}, true},
{{{2,1}, {2,3}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 4UL);
}
<API key>(touching_no_overlap) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{1,20}, {40,50}}, true},
{{{40,50}, {80,90}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 2UL);
}
<API key>(<API key>) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{10,10}, {0,0}}, false},
{{{9,9}, {20,20}}, true},
{{{30,30}, {15,15}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 7UL);
//print_result(result);
}
<API key>(<API key>) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{10,10}, {0,0}}, true},
{{{9,9}, {20,20}}, false},
{{{30,30}, {15,15}}, false},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 7UL);
//print_result(result);
}
<API key>(sort_segments) {
vector<pair<linestring_type_fp, bool>> ms = {
{{{10,10}, {13,-4}}, true},
{{{13,-4}, {10,10}}, true},
{{{13,-4}, {10,10}}, true},
{{{10, 10}, {13, -4}}, true},
{{{10, 10}, {13, -4}}, true},
};
const auto& result = segmentize::segmentize_paths(ms);
BOOST_CHECK_EQUAL(result.size(), 5UL);
//print_result(result);
}
<API key>()
|
<?php
/**
* Simple product add to cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
global $woocommerce, $product;
if ( ! $product->is_purchasable() ) return;
?>
<?php
// Availability
$availability = $product->get_availability();
if ($availability['availability']) :
echo apply_filters( '<API key>', '<p class="stock '.$availability['class'].'">'.$availability['availability'].'</p>', $availability['availability'] );
endif;
?>
<?php if ( $product->is_in_stock() && is_shop_enabled() ) : ?>
<?php do_action('<API key>'); ?>
<form action="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="cart" method="post" enctype='multipart/form-data'>
<?php do_action('<API key>'); ?>
<?php
if ( ! $product-><API key>() ){
?><label><?php _e( 'Quantity', 'yit' ) ?></label><?php
<API key>( array(
'min_value' => apply_filters( '<API key>', 1, $product ),
'max_value' => apply_filters( '<API key>', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product )
) );
}
$label = apply_filters( '<API key>', yit_get_option( 'add-to-cart-text' ) );
?>
<button type="submit" class="<API key> button alt"><?php echo $label ?></button>
<?php do_action('<API key>'); ?>
</form>
<?php do_action('<API key>'); ?>
<?php endif; ?>
|
#include <stdio.h>
#include "aeb.h"
#include <string.h>
#include <math.h>
int main() {
Aeb * raiz, *esq, * dir;
Aeb * arvore;
double r;
char s[127];
/*arvore = criaRaiz('*');
esq = criaFolha(10.0);
dir = criaFolha(7.0);
conectaNodos(arvore, esq, dir);
raiz = criaRaiz('+');
dir = criaFolha(8.0);
conectaNodos(raiz, arvore, dir);
printf("Resultado: %g\n", resolveExpressao(raiz));*/
printf("\nExpressão: ");
scanf("%s",s);
arvore = criaArvore(s);
printf("Expressão após conversão: ");
mostraArvore(arvore);
puts("");
r=resolveExpressao(arvore);
printf("\nO resultado é= %g\n",r);
}
|
/**
* dfs LCA. tarjan rmq
* rmq dfs( u v )
*/
using namespace std;
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *dfs(TreeNode *root, TreeNode* p, TreeNode *q) {
if(!root)
return NULL;
if(root == p)
return root;
if(root == q)
return root;
TreeNode *u = dfs(root->left, p, q);
TreeNode *v = dfs(root->right, p, q);
if(u == NULL) {
u = v; v = NULL;
}
if(v)
return root;
return u;
}
TreeNode* <API key>(TreeNode* root, TreeNode* p, TreeNode* q) {
return dfs(root, p, q);
}
};
|
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using NFluent;
using SmallWorld.BusinessEntities.Football.DeedDetectors;
using SmallWorld.BusinessEntities.Interfaces.Football.Agents;
namespace SmallWorld.BusinessEntities.UnitTests.Football.DeedDetectors
{
[TestClass]
public class MoveDetectorTest
{
[TestMethod]
public void <API key>()
{
var moveDetector = new MoveDetector();
var origin = new Mock<IFootballPlayer>();
var playerOne = new Mock<IFootballPlayer>();
var playerTwo = new Mock<IFootballPlayer>();
var sensedPlayers = new List<IFootballPlayer>
{
playerOne.Object, playerTwo.Object
};
var result = moveDetector.Detect(origin.Object, sensedPlayers);
foreach (var tmpFootballDeed in result)
{
Check.That(tmpFootballDeed.Player).IsSameReferenceThan(origin.Object);
}
}
}
}
|
package org.b3log.symphony.service;
import java.util.List;
import java.util.Locale;
import javax.inject.Inject;
import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Keys;
import org.b3log.latke.event.Event;
import org.b3log.latke.event.EventException;
import org.b3log.latke.event.EventManager;
import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger;
import org.b3log.latke.model.User;
import org.b3log.latke.repository.RepositoryException;
import org.b3log.latke.repository.Transaction;
import org.b3log.latke.repository.annotation.Transactional;
import org.b3log.latke.service.LangPropsService;
import org.b3log.latke.service.ServiceException;
import org.b3log.latke.service.annotation.Service;
import org.b3log.latke.util.Ids;
import org.b3log.symphony.event.EventTypes;
import org.b3log.symphony.model.Article;
import org.b3log.symphony.model.Comment;
import org.b3log.symphony.model.Common;
import org.b3log.symphony.model.Liveness;
import org.b3log.symphony.model.Notification;
import org.b3log.symphony.model.Option;
import org.b3log.symphony.model.Pointtransfer;
import org.b3log.symphony.model.Reward;
import org.b3log.symphony.model.Role;
import org.b3log.symphony.model.Tag;
import org.b3log.symphony.model.UserExt;
import org.b3log.symphony.repository.ArticleRepository;
import org.b3log.symphony.repository.CommentRepository;
import org.b3log.symphony.repository.<API key>;
import org.b3log.symphony.repository.OptionRepository;
import org.b3log.symphony.repository.<API key>;
import org.b3log.symphony.repository.TagRepository;
import org.b3log.symphony.repository.UserRepository;
import org.b3log.symphony.util.Emotions;
import org.b3log.symphony.util.Symphonys;
import org.json.JSONObject;
@Service
public class CommentMgmtService {
/**
* Logger.
*/
private static final Logger LOGGER = Logger.getLogger(CommentMgmtService.class.getName());
/**
* Comment repository.
*/
@Inject
private CommentRepository commentRepository;
/**
* Article repository.
*/
@Inject
private ArticleRepository articleRepository;
/**
* Option repository.
*/
@Inject
private OptionRepository optionRepository;
/**
* Tag repository.
*/
@Inject
private TagRepository tagRepository;
/**
* Tag-Article repository.
*/
@Inject
private <API key> <API key>;
/**
* User repository.
*/
@Inject
private UserRepository userRepository;
/**
* Notification repository.
*/
@Inject
private <API key> <API key>;
/**
* Event manager.
*/
@Inject
private EventManager eventManager;
/**
* Language service.
*/
@Inject
private LangPropsService langPropsService;
/**
* Pointtransfer management service.
*/
@Inject
private <API key> <API key>;
/**
* Reward management service.
*/
@Inject
private RewardMgmtService rewardMgmtService;
/**
* Reward query service.
*/
@Inject
private RewardQueryService rewardQueryService;
/**
* Notification management service.
*/
@Inject
private <API key> <API key>;
/**
* Liveness management service.
*/
@Inject
private LivenessMgmtService livenessMgmtService;
/**
* Removes a comment specified with the given comment id.
*
* @param commentId the given comment id
*/
@Transactional
public void removeComment(final String commentId) {
try {
final JSONObject comment = commentRepository.get(commentId);
if (null == comment) {
return;
}
final String articleId = comment.optString(Comment.<API key>);
final JSONObject article = articleRepository.get(articleId);
article.put(Article.ARTICLE_COMMENT_CNT, article.optInt(Article.ARTICLE_COMMENT_CNT) - 1);
// Just clear latest time and commenter name, do not get the real latest comment to update
article.put(Article.<API key>, 0);
article.put(Article.<API key>, "");
articleRepository.update(articleId, article);
final String commentAuthorId = comment.optString(Comment.COMMENT_AUTHOR_ID);
final JSONObject commenter = userRepository.get(commentAuthorId);
commenter.put(UserExt.USER_COMMENT_COUNT, commenter.optInt(UserExt.USER_COMMENT_COUNT) - 1);
userRepository.update(commentAuthorId, commenter);
commentRepository.remove(comment.optString(Keys.OBJECT_ID));
final JSONObject commentCntOption = optionRepository.get(Option.<API key>);
commentCntOption.put(Option.OPTION_VALUE, commentCntOption.optInt(Option.OPTION_VALUE) - 1);
optionRepository.update(Option.<API key>, commentCntOption);
<API key>.removeByDataId(commentId);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Removes a comment error [id=" + commentId + "]", e);
}
}
/**
* A user specified by the given sender id thanks the author of a comment specified by the given comment id.
*
* @param commentId the given comment id
* @param senderId the given sender id
* @throws ServiceException service exception
*/
public void thankComment(final String commentId, final String senderId) throws ServiceException {
try {
final JSONObject comment = commentRepository.get(commentId);
if (null == comment) {
return;
}
if (Comment.<API key> == comment.optInt(Comment.COMMENT_STATUS)) {
return;
}
final JSONObject sender = userRepository.get(senderId);
if (null == sender) {
return;
}
if (UserExt.USER_STATUS_C_VALID != sender.optInt(UserExt.USER_STATUS)) {
return;
}
final String receiverId = comment.optString(Comment.COMMENT_AUTHOR_ID);
final JSONObject receiver = userRepository.get(receiverId);
if (null == receiver) {
return;
}
if (UserExt.USER_STATUS_C_VALID != receiver.optInt(UserExt.USER_STATUS)) {
return;
}
if (receiverId.equals(senderId)) {
throw new ServiceException(langPropsService.get("thankSelfLabel"));
}
final int rewardPoint = Symphonys.getInt("pointThankComment");
if (rewardQueryService.isRewarded(senderId, commentId, Reward.TYPE_C_COMMENT)) {
return;
}
final String rewardId = Ids.genTimeMillisId();
if (Comment.<API key> == comment.optInt(Comment.COMMENT_ANONYMOUS)) {
final boolean succ = null != <API key>.transfer(senderId, receiverId,
Pointtransfer.<API key>, rewardPoint, rewardId, System.currentTimeMillis());
if (!succ) {
throw new ServiceException(langPropsService.get("transferFailLabel"));
}
}
final JSONObject reward = new JSONObject();
reward.put(Keys.OBJECT_ID, rewardId);
reward.put(Reward.SENDER_ID, senderId);
reward.put(Reward.DATA_ID, commentId);
reward.put(Reward.TYPE, Reward.TYPE_C_COMMENT);
rewardMgmtService.addReward(reward);
final JSONObject notification = new JSONObject();
notification.put(Notification.<API key>, receiverId);
notification.put(Notification.<API key>, rewardId);
<API key>.<API key>(notification);
livenessMgmtService.incLiveness(senderId, Liveness.LIVENESS_THANK);
} catch (final RepositoryException e) {
LOGGER.log(Level.ERROR, "Thanks a comment[id=" + commentId + "] failed", e);
throw new ServiceException(e);
}
}
/**
* Adds a comment with the specified request json object.
*
* @param requestJSONObject the specified request json object, for example, <pre>
* {
* "commentContent": "",
* "commentAuthorId": "",
* "commentOnArticleId": "",
* "<API key>": "", // optional
* "clientCommentId": "" // optional,
* "commentAuthorName": "" // If from client
* "commenter": {
* // User model
* },
* "commentIP": "", // optional, default to ""
* "commentUA": "", // optional, default to ""
* "commentAnonymous": int, // optional, default to 0 (public)
* "userCommentViewMode": int
* }
* </pre>, see {@link Comment} for more details
*
* @return generated comment id
* @throws ServiceException service exception
*/
public synchronized String addComment(final JSONObject requestJSONObject) throws ServiceException {
final long currentTimeMillis = System.currentTimeMillis();
final JSONObject commenter = requestJSONObject.optJSONObject(Comment.COMMENT_T_COMMENTER);
final String commentAuthorId = requestJSONObject.optString(Comment.COMMENT_AUTHOR_ID);
final boolean fromClient = requestJSONObject.has(Comment.<API key>);
final String articleId = requestJSONObject.optString(Comment.<API key>);
final String ip = requestJSONObject.optString(Comment.COMMENT_IP);
String ua = requestJSONObject.optString(Comment.COMMENT_UA);
final int commentAnonymous = requestJSONObject.optInt(Comment.COMMENT_ANONYMOUS);
final int commentViewMode = requestJSONObject.optInt(UserExt.<API key>);
if (currentTimeMillis - commenter.optLong(UserExt.<API key>) < Symphonys.getLong("minStepCmtTime")
&& !Role.ROLE_ID_C_ADMIN.equals(commenter.optString(User.USER_ROLE))
&& !UserExt.DEFAULT_CMTER_ROLE.equals(commenter.optString(User.USER_ROLE))) {
LOGGER.log(Level.WARN, "Adds comment too frequent [userName={0}]", commenter.optString(User.USER_NAME));
throw new ServiceException(langPropsService.get("tooFrequentCmtLabel"));
}
final String commenterName = commenter.optString(User.USER_NAME);
JSONObject article = null;
try {
// check if admin allow to add comment
final JSONObject option = optionRepository.get(Option.<API key>);
if (!"0".equals(option.optString(Option.OPTION_VALUE))) {
throw new ServiceException(langPropsService.get("<API key>"));
}
final int balance = commenter.optInt(UserExt.USER_POINT);
if (Comment.<API key> == commentAnonymous) {
final int anonymousPoint = Symphonys.getInt("anonymous.point");
if (balance < anonymousPoint) {
String <API key> = langPropsService.get("<API key>");
<API key>
= <API key>.replace("${point}", String.valueOf(anonymousPoint));
throw new ServiceException(<API key>);
}
}
article = articleRepository.get(articleId);
if (!fromClient && !TuringQueryService.ROBOT_NAME.equals(commenterName)) {
int pointSum = Pointtransfer.<API key>;
// Point
final String articleAuthorId = article.optString(Article.ARTICLE_AUTHOR_ID);
if (articleAuthorId.equals(commentAuthorId)) {
pointSum = Pointtransfer.<API key>;
}
if (balance - pointSum < 0) {
throw new ServiceException(langPropsService.get("<API key>"));
}
}
} catch (final RepositoryException e) {
throw new ServiceException(e);
}
final int articleAnonymous = article.optInt(Article.ARTICLE_ANONYMOUS);
final Transaction transaction = commentRepository.beginTransaction();
try {
article.put(Article.ARTICLE_COMMENT_CNT, article.optInt(Article.ARTICLE_COMMENT_CNT) + 1);
article.put(Article.<API key>, commenter.optString(User.USER_NAME));
if (Comment.<API key> == commentAnonymous) {
article.put(Article.<API key>, UserExt.ANONYMOUS_USER_NAME);
}
article.put(Article.<API key>, currentTimeMillis);
final String ret = Ids.genTimeMillisId();
final JSONObject comment = new JSONObject();
comment.put(Keys.OBJECT_ID, ret);
String content = requestJSONObject.optString(Comment.COMMENT_CONTENT).
replace("_esc_enter_88250_", "<br/>"); // Solo client escape
comment.put(Comment.COMMENT_AUTHOR_ID, commentAuthorId);
comment.put(Comment.<API key>, articleId);
if (fromClient) {
comment.put(Comment.<API key>, requestJSONObject.optString(Comment.<API key>));
// Appends original commenter name
final String authorName = requestJSONObject.optString(Comment.<API key>);
content += " <i class='ft-small'>by " + authorName + "</i>";
}
final String originalCmtId = requestJSONObject.optString(Comment.<API key>);
comment.put(Comment.<API key>, originalCmtId);
if (StringUtils.isNotBlank(originalCmtId)) {
final JSONObject originalCmt = commentRepository.get(originalCmtId);
final int originalCmtReplyCnt = originalCmt.optInt(Comment.COMMENT_REPLY_CNT);
originalCmt.put(Comment.COMMENT_REPLY_CNT, originalCmtReplyCnt + 1);
commentRepository.update(originalCmtId, originalCmt);
}
content = Emotions.toAliases(content);
content = content.replace(langPropsService.get("uploadingLabel", Locale.SIMPLIFIED_CHINESE), "");
content = content.replace(langPropsService.get("uploadingLabel", Locale.US), "");
comment.put(Comment.COMMENT_CONTENT, content);
comment.put(Comment.COMMENT_CREATE_TIME, System.currentTimeMillis());
comment.put(Comment.COMMENT_SHARP_URL, "/article/" + articleId + "#" + ret);
comment.put(Comment.COMMENT_STATUS, Comment.<API key>);
comment.put(Comment.COMMENT_IP, ip);
if (StringUtils.length(ua) > Common.MAX_LENGTH_UA) {
LOGGER.log(Level.WARN, "UA is too long [" + ua + "]");
ua = StringUtils.substring(ua, 0, Common.MAX_LENGTH_UA);
}
comment.put(Comment.COMMENT_UA, ua);
comment.put(Comment.COMMENT_ANONYMOUS, commentAnonymous);
final JSONObject cmtCntOption = optionRepository.get(Option.<API key>);
final int cmtCnt = cmtCntOption.optInt(Option.OPTION_VALUE);
cmtCntOption.put(Option.OPTION_VALUE, String.valueOf(cmtCnt + 1));
articleRepository.update(articleId, article); // Updates article comment count, latest commenter name and time
optionRepository.update(Option.<API key>, cmtCntOption); // Updates global comment count
// Updates tag comment count and User-Tag relation
final String tagsString = article.optString(Article.ARTICLE_TAGS);
final String[] tagStrings = tagsString.split(",");
for (int i = 0; i < tagStrings.length; i++) {
final String tagTitle = tagStrings[i].trim();
final JSONObject tag = tagRepository.getByTitle(tagTitle);
tag.put(Tag.TAG_COMMENT_CNT, tag.optInt(Tag.TAG_COMMENT_CNT) + 1);
tag.put(Tag.TAG_RANDOM_DOUBLE, Math.random());
tagRepository.update(tag.optString(Keys.OBJECT_ID), tag);
}
// Updates user comment count, latest comment time
commenter.put(UserExt.USER_COMMENT_COUNT, commenter.optInt(UserExt.USER_COMMENT_COUNT) + 1);
commenter.put(UserExt.<API key>, currentTimeMillis);
userRepository.update(commenter.optString(Keys.OBJECT_ID), commenter);
comment.put(Comment.COMMENT_GOOD_CNT, 0);
comment.put(Comment.COMMENT_BAD_CNT, 0);
comment.put(Comment.COMMENT_SCORE, 0D);
comment.put(Comment.COMMENT_REPLY_CNT, 0);
// Adds the comment
final String commentId = commentRepository.add(comment);
// Updates tag-article relation stat.
final List<JSONObject> tagArticleRels = <API key>.getByArticleId(articleId);
for (final JSONObject tagArticleRel : tagArticleRels) {
tagArticleRel.put(Article.<API key>, currentTimeMillis);
tagArticleRel.put(Article.ARTICLE_COMMENT_CNT, article.optInt(Article.ARTICLE_COMMENT_CNT));
<API key>.update(tagArticleRel.optString(Keys.OBJECT_ID), tagArticleRel);
}
transaction.commit();
if (!fromClient && Comment.<API key> == commentAnonymous
&& Article.<API key> == articleAnonymous
&& !TuringQueryService.ROBOT_NAME.equals(commenterName)) {
// Point
final String articleAuthorId = article.optString(Article.ARTICLE_AUTHOR_ID);
if (articleAuthorId.equals(commentAuthorId)) {
<API key>.transfer(commentAuthorId, Pointtransfer.ID_C_SYS,
Pointtransfer.<API key>, Pointtransfer.<API key>,
commentId, System.currentTimeMillis());
} else {
<API key>.transfer(commentAuthorId, articleAuthorId,
Pointtransfer.<API key>, Pointtransfer.<API key>,
commentId, System.currentTimeMillis());
}
livenessMgmtService.incLiveness(commentAuthorId, Liveness.LIVENESS_COMMENT);
}
// Event
final JSONObject eventData = new JSONObject();
eventData.put(Comment.COMMENT, comment);
eventData.put(Common.FROM_CLIENT, fromClient);
eventData.put(Article.ARTICLE, article);
eventData.put(UserExt.<API key>, commentViewMode);
try {
eventManager.<API key>(new Event<JSONObject>(EventTypes.<API key>, eventData));
} catch (final EventException e) {
LOGGER.log(Level.ERROR, e.getMessage(), e);
}
return ret;
} catch (final RepositoryException e) {
if (transaction.isActive()) {
transaction.rollback();
}
LOGGER.log(Level.ERROR, "Adds a comment failed", e);
throw new ServiceException(e);
}
}
/**
* Updates the specified comment by the given comment id.
*
* @param commentId the given comment id
* @param comment the specified comment
* @throws ServiceException service exception
*/
public void updateComment(final String commentId, final JSONObject comment) throws ServiceException {
final Transaction transaction = commentRepository.beginTransaction();
try {
String content = comment.optString(Comment.COMMENT_CONTENT);
content = Emotions.toAliases(content);
content = StringUtils.trim(content) + " ";
content = content.replace(langPropsService.get("uploadingLabel", Locale.SIMPLIFIED_CHINESE), "");
content = content.replace(langPropsService.get("uploadingLabel", Locale.US), "");
comment.put(Comment.COMMENT_CONTENT, content);
commentRepository.update(commentId, comment);
transaction.commit();
} catch (final RepositoryException e) {
if (transaction.isActive()) {
transaction.rollback();
}
LOGGER.log(Level.ERROR, "Updates a comment[id=" + commentId + "] failed", e);
throw new ServiceException(e);
}
}
}
|
static inline struct pthread *__pthread_self()
{
struct pthread *self;
__asm__ ("mov %%fs:0,%0" : "=r" (self) );
return self;
}
#define TP_ADJ(p) (p)
#define MC_PC gregs[REG_RIP]
|
/** \file
* %Lattice Boltzmann implementation on GPUs.
*
* Implementation in lbgpu.cpp.
*/
#ifndef LBGPU_HPP
#define LBGPU_HPP
#include "config.hpp"
#ifdef CUDA
#include "OptionalCounter.hpp"
#include <utils/Vector.hpp>
#include <utils/index.hpp>
#include <cstddef>
#include <cstdint>
#include <vector>
/* For the D3Q19 model most functions have a separate implementation
* where the coefficients and the velocity vectors are hardcoded
* explicitly. This saves a lot of multiplications with 1's and 0's
* thus making the code more efficient. */
#define LBQ 19
/** Parameters for the lattice Boltzmann system for GPU. */
struct LB_parameters_gpu {
/** number density (LB units) */
float rho;
/** mu (LJ units) */
float mu;
/** viscosity (LJ) units */
float viscosity;
/** relaxation rate of shear modes */
float gamma_shear;
/** relaxation rate of bulk modes */
float gamma_bulk;
float gamma_odd;
float gamma_even;
/** flag determining whether gamma_shear, gamma_odd, and gamma_even are
* calculated from gamma_shear in such a way to yield a TRT LB with minimized
* slip at bounce-back boundaries
*/
bool is_TRT;
float bulk_viscosity;
/** lattice spacing (LJ units) */
float agrid;
/** time step for fluid propagation (LJ units)
* Note: Has to be larger than MD time step!
*/
float tau;
/** MD timestep */
float time_step;
Utils::Array<unsigned int, 3> dim;
unsigned int number_of_nodes;
#ifdef LB_BOUNDARIES_GPU
unsigned int <API key>;
#endif
/** to calculate and print out physical values */
int calc_val;
int <API key>;
Utils::Array<float, 3> ext_force_density;
unsigned int reinit;
// Thermal energy
float kT;
};
/* this structure is almost duplicated for memory efficiency. When the stress
tensor element are needed at every timestep, this features should be
explicitly switched on */
struct LB_rho_v_pi_gpu {
/** density of the node */
float rho;
/** velocity of the node */
Utils::Array<float, 3> v;
/** pressure tensor */
Utils::Array<float, 6> pi;
};
struct <API key> {
Utils::Array<float, 3> *force_density;
#if defined(<API key>) || defined(EK_DEBUG)
// We need the node forces for the velocity interpolation at the virtual
// particles' position. However, LBM wants to reset them immediately
// after the LBM update. This variable keeps a backup
Utils::Array<float, 3> *force_density_buf;
#endif
};
/** \name Exported Variables */
/** Switch indicating momentum exchange between particles and fluid */
extern LB_parameters_gpu lbpar_gpu;
extern std::vector<LB_rho_v_pi_gpu> host_values;
#ifdef ELECTROKINETICS
extern <API key> node_f;
extern bool ek_initialized;
#endif
extern OptionalCounter <API key>;
extern OptionalCounter <API key>;
/** \name Exported Functions */
/** Conserved quantities for the lattice Boltzmann system. */
struct LB_rho_v_gpu {
/** density of the node */
float rho;
/** velocity of the node */
Utils::Array<float, 3> v;
};
void <API key>();
void <API key>(LB_rho_v_gpu **pointer_address);
void <API key>(float **pointer_address);
void lb_get_para_pointer(LB_parameters_gpu **pointer_address);
void <API key>();
/** Perform a full initialization of the lattice Boltzmann system.
* All derived parameters and the fluid are reset to their default values.
*/
void lb_init_gpu();
/** (Re-)initialize the derived parameters for the lattice Boltzmann system.
* The current state of the fluid is unchanged.
*/
void <API key>();
/** (Re-)initialize the fluid. */
void lb_reinit_fluid_gpu();
/** Reset the forces on the fluid nodes */
void <API key>(bool buffer = true);
void lb_init_GPU(const LB_parameters_gpu &lbpar_gpu);
void lb_integrate_GPU();
void lb_get_values_GPU(LB_rho_v_pi_gpu *host_values);
void lb_print_node_GPU(unsigned single_nodeindex,
LB_rho_v_pi_gpu *host_print_values);
#ifdef LB_BOUNDARIES_GPU
void <API key>(std::size_t n_lb_boundaries,
unsigned <API key>,
int *<API key>,
int *<API key>,
float *lb_bounday_velocity);
#endif
void lb_set_agrid_gpu(double agrid);
template <std::size_t no_of_neighbours>
void <API key>(bool couple_virtual, double friction);
void <API key>(double *mass);
void <API key>(double *host_mom);
void <API key>(unsigned int single_nodeindex,
unsigned int *host_flag);
void <API key>(unsigned int *host_bound_array);
void <API key>(unsigned single_nodeindex, float *host_velocity);
void lb_set_node_rho_GPU(unsigned single_nodeindex, float host_rho);
void <API key>(LB_parameters_gpu *lbpar_gpu);
void <API key>(LB_parameters_gpu *lbpar_gpu);
void lb_reinit_GPU(LB_parameters_gpu *lbpar_gpu);
void <API key>(std::vector<double> &forces);
void <API key>(float *host_checkpoint_vd);
void <API key>(float const *host_checkpoint_vd);
void <API key>(const Utils::Vector3i &, float[LBQ]);
void <API key>(const Utils::Vector3i &, float[LBQ]);
template <std::size_t no_of_neighbours>
void <API key>(double const *positions,
double *velocities, int length);
void <API key>(double const *positions, double *velocities,
int length);
void <API key>(double const *positions,
double *velocities, int length);
Utils::Array<float, 6> stress_tensor_GPU();
uint64_t <API key>();
void <API key>(uint64_t counter);
uint64_t <API key>();
void <API key>(uint64_t counter);
/** Calculate the node index from its coordinates */
inline unsigned int <API key>(LB_parameters_gpu const &lbpar,
Utils::Vector3i const &coord) {
return static_cast<unsigned>(
Utils::get_linear_index(coord, Utils::Vector3i(lbpar_gpu.dim)));
}
#endif /* CUDA */
#endif /* LBGPU_HPP */
|
package org.alanwilliamson.openbd.plugin.crontab;
import com.naryx.tagfusion.cfm.engine.cfArgStructData;
import com.naryx.tagfusion.cfm.engine.cfBooleanData;
import com.naryx.tagfusion.cfm.engine.cfData;
import com.naryx.tagfusion.cfm.engine.cfSession;
import com.naryx.tagfusion.cfm.engine.cfmRunTimeException;
import com.naryx.tagfusion.expression.function.functionBase;
public class CronSetDirectory extends functionBase {
private static final long serialVersionUID = 1L;
public CronSetDirectory(){ min = max = 1; setNamedParams( new String[]{ "directory" } ); }
public String[] getParamInfo(){
return new String[]{
"uri directory - will be created if not exists",
};
}
public java.util.Map getInfo(){
return makeInfo(
"system",
"Sets the URI directory that the cron tasks will run from. Calling this function will enable the crontab scheduler to start. This persists across server restarts",
ReturnType.BOOLEAN );
}
public cfData execute(cfSession _session, cfArgStructData argStruct ) throws cfmRunTimeException {
CronExtension.setRootPath( getNamedStringParam(argStruct, "directory", null ) );
return cfBooleanData.TRUE;
}
}
|
package com.gentasaurus.ubahfood.inventory;
import com.gentasaurus.ubahfood.init.ModBlocks;
import com.gentasaurus.ubahfood.item.crafting.SCMCraftingManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ContainerSCM extends Container
{
/** The crafting matrix inventory (3x3). */
public InventoryCrafting craftMatrix;
public IInventory craftResult;
private World worldObj;
private int posX;
private int posY;
private int posZ;
public ContainerSCM(InventoryPlayer invPlayer, World world, int x, int y, int z)
{
craftMatrix = new InventoryCrafting(this, 3, 1);
craftResult = new <API key>();
worldObj = world;
posX = x;
posY = y;
posZ = z;
this.addSlotToContainer(new SlotSCM(invPlayer.player, craftMatrix, craftResult, 0, 124, 35));
int i;
int i1;
for (i = 0; i < 3; i++)
{
for (i1 = 0; i1 < 1; i1++)
{
this.addSlotToContainer(new Slot(this.craftMatrix, i1 + i * 1, 57 + i1 * 18, 17 + i * 18));
}
}
for (i = 0; i < 3; ++i)
{
for (i1 = 0; i1 < 9; ++i1)
{
this.addSlotToContainer(new Slot(invPlayer, i1 + i * 9 + 9, 8 + i1 * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
}
this.<API key>(craftMatrix);
}
/**
* Callback for when the crafting matrix is changed.
*/
public void <API key>(IInventory p_75130_1_)
{
craftResult.<API key>(0, SCMCraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
}
/**
* Called when the container is closed.
*/
public void onContainerClosed(EntityPlayer p_75134_1_)
{
super.onContainerClosed(p_75134_1_);
if (!this.worldObj.isRemote)
{
for (int i = 0; i < 3; ++i)
{
ItemStack itemstack = this.craftMatrix.<API key>(i);
if (itemstack != null)
{
p_75134_1_.<API key>(itemstack, false);
}
}
}
}
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.snowConeMachine ? false : p_75145_1_.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
}
/**
* Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
*/
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
{
return null;
}
public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_)
{
return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}
}
|
#ifndef __MACROS_H__
#define __MACROS_H__
#include "config.h"
#define __KERNELNAME__ "code0"
/*
* This file is automatically included before the first line of any
* source file, using gcc's -imacro command line option. Only macro
* definitions will be extracted.
*/
#define INC_ARCH(x) <l4/arch/__ARCH__/x>
#define INC_SUBARCH(x) <l4/arch/__ARCH__/__SUBARCH__/x>
#define INC_CPU(x) <l4/arch/__ARCH__/__SUBARCH__/__CPU__/x>
#define INC_PLAT(x) <l4/platform/__PLATFORM__/x>
#define INC_API(x) <l4/api/x>
#define INC_GLUE(x) <l4/glue/__ARCH__/x>
#define __initdata SECTION(".init.data")
/*
* FIXME: Remove __CPP__
* This is defined in kernel linker.lds.in,
* find some better way.
*/
#if !defined(__CPP__)
/* use this to place code/data in a certain section */
#define SECTION(x) __attribute__((section(x)))
#define ALIGN(x) __attribute__((aligned (x)))
#endif
/* Functions for critical path optimizations */
#if (__GNUC__ >= 3)
#define unlikely(x) __builtin_expect((x), false)
#define likely(x) __builtin_expect((x), true)
#define likelyval(x,val) __builtin_expect((x), (val))
#else /* __GNUC__ < 3 */
#define likely(x) (x)
#define unlikely(x) (x)
#define likelyval(x,val) (x)
#endif /* __GNUC__ < 3 */
/* This guard is needed because tests use host C library and NULL is defined */
#ifndef NULL
#define NULL 0
#endif
/* Convenience functions for memory sizes. */
#define SZ_1K 1024
#define SZ_2K 2048
#define SZ_4K 0x1000
#define SZ_16K 0x4000
#define SZ_32K 0x8000
#define SZ_64K 0x10000
#define SZ_1MB 0x100000
#define SZ_2MB 0x200000
#define SZ_4MB (4*SZ_1MB)
#define SZ_8MB (8*SZ_1MB)
#define SZ_16MB (16*SZ_1MB)
#define SZ_1K_BITS 10
#define SZ_4K_BITS 12
#define SZ_16K_BITS 14
#define SZ_1MB_BITS 20
/* Per-cpu variables */
#if defined CONFIG_SMP
#define DECLARE_PERCPU(type, name) \
type name[CONFIG_NCPU]
#define per_cpu(val) (val)[smp_get_cpuid()]
#define per_cpu_byid(val, cpu) (val)[(cpu)]
#else /* Not CONFIG_SMP */
#define DECLARE_PERCPU(type, name) \
type name
#define per_cpu(val) (val)
#define per_cpu_byid(val, cpu) val
#endif /* End of Not CONFIG_SMP */
#ifndef __ASSEMBLY__
#include <stddef.h> /* offsetof macro, defined in the `standard' way. */
#endif
#define container_of(ptr, struct_type, field) \
({ \
const typeof(((struct_type *)0)->field) *field_ptr = (ptr); \
(struct_type *)((char *)field_ptr - offsetof(struct_type, field)); \
})
/* Prefetching is noop for now */
#define prefetch(x) x
#if !defined(__KERNEL__)
#define printk printf
#endif
/* Converts an int-sized field offset in a struct into a bit offset in a word */
#define FIELD_TO_BIT(type, field) (1 << (offsetof(type, field) >> 2))
/* Functions who may either return a pointer or an error code can use these: */
#define PTR_ERR(x) ((void *)(x))
/* checks up to -1000, the rest might be valid pointers!!! E.g. 0xE0000000 */
// #define IS_ERR(x) ((((int)(x)) < 0) && (((int)(x) > -1000)))
#if !defined(__ASSEMBLY__)
#define IS_ERR(x) is_err((int)(x))
static inline int is_err(int x)
{
return x < 0 && x > -0x1000;
}
#endif
/* TEST: Is this type of printk well tested? */
#define BUG() {do { \
printk("BUG in file: %s function: %s line: %d\n", \
__FILE__, __FUNCTION__, __LINE__); \
} while(0); \
while(1);}
#define BUG_ON(x) {if (x) BUG();}
#define WARN_ON(x) {if (x) printk("%s, %s, %s: Warning something is off here.\n", __FILE__, __FUNCTION__, __LINE__); }
#define BUG_ON_MSG(msg, x) do { \
printk(msg); \
BUG_ON(x) \
} while(0)
#define BUG_MSG(msg...) do { \
printk(msg); \
BUG(); \
} while(0)
#endif /* __MACROS_H__ */
|
#include "prism/animation.h"
#include <stdlib.h>
#include "prism/log.h"
#include "prism/datastructures.h"
#include "prism/memoryhandler.h"
#include "prism/system.h"
#include "prism/timer.h"
#include "prism/stlutil.h"
using namespace std;
static struct {
int mIsPaused;
} gPrismAnimationData;
int getDurationInFrames(Duration tDuration){
return (int)(tDuration * <API key>());
}
int <API key>(Duration* tNow, Duration tDuration) {
if(gPrismAnimationData.mIsPaused) return 0;
(*tNow)++;
return isDurationOver(*tNow, tDuration);
}
int isDurationOver(Duration tNow, Duration tDuration) {
if (tNow >= getDurationInFrames(tDuration)) {
return 1;
}
return 0;
}
int <API key>(Tick * tNow, Tick tDuration)
{
if (gPrismAnimationData.mIsPaused) return 0;
(*tNow)++;
return isTickDurationOver(*tNow, tDuration);
}
int isTickDurationOver(Tick tNow, Tick tDuration)
{
if (tNow >= tDuration) {
return 1;
}
return 0;
}
AnimationResult animateWithoutLoop(Animation* tAnimation) {
AnimationResult ret = <API key>;
if (<API key>(&tAnimation->mNow, tAnimation->mDuration)) {
tAnimation->mNow = 0;
tAnimation->mFrame++;
if (tAnimation->mFrame >= tAnimation->mFrameAmount) {
tAnimation->mFrame = tAnimation->mFrameAmount-1;
tAnimation->mNow = getDurationInFrames(tAnimation->mDuration);
ret = ANIMATION_OVER;
}
}
return ret;
}
void animate(Animation* tAnimation) {
AnimationResult ret = animateWithoutLoop(tAnimation);
if(ret == ANIMATION_OVER){
resetAnimation(tAnimation);
}
}
void resetAnimation(Animation* tAnimation) {
tAnimation->mNow = 0;
tAnimation->mFrame = 0;
}
Animation createAnimation(int tFrameAmount, Duration tDuration) {
Animation ret = <API key>();
ret.mFrameAmount = tFrameAmount;
ret.mDuration = tDuration;
return ret;
}
Animation <API key>(){
Animation ret;
ret.mFrame = 0;
ret.mFrameAmount = 0;
ret.mNow = 0;
ret.mDuration = 1000000000;
return ret;
}
Animation <API key>(){
Animation ret = <API key>();
ret.mFrameAmount = 1;
return ret;
}
void <API key>() {
gPrismAnimationData.mIsPaused = 1;
}
void <API key>() {
gPrismAnimationData.mIsPaused = 0;
}
double <API key>(Duration tNow, Duration tDuration)
{
int duration = getDurationInFrames(tDuration);
return tNow / (double)duration;
}
static struct{
map<int, <API key>> mList;
int mIsLoaded;
} gAnimationHandler;
void <API key>(){
if(gAnimationHandler.mIsLoaded){
logWarning("Setting up non-empty animation handler; Cleaning up.");
<API key>();
}
gAnimationHandler.mList.clear();
gAnimationHandler.mIsLoaded = 1;
}
static int updateAndRemoveCB(void* tCaller, <API key>& tData) {
(void) tCaller;
<API key>* cur = &tData;
AnimationResult res = animateWithoutLoop(&cur->mAnimation);
if(res == ANIMATION_OVER) {
if(cur->mCB != NULL) {
cur->mCB(cur->mCaller);
}
if(cur->mIsLooped) {
resetAnimation(&cur->mAnimation);
} else {
return 1;
}
}
return 0;
}
void <API key>(){
<API key>(gAnimationHandler.mList, updateAndRemoveCB);
}
static Position <API key>(<API key>* cur) {
Position p = cur->mPosition;
if (cur-><API key> != NULL) {
p = vecAdd(p, vecScale(*cur-><API key>, -1));
}
if (cur-><API key> != NULL) {
p = vecAdd(p, *(cur-><API key>));
}
return p;
}
static void <API key>(void* tCaller, <API key>& tData) {
(void) tCaller;
<API key>* cur = &tData;
if (!cur->mIsVisible) return;
int frame = cur->mAnimation.mFrame;
Position p = <API key>(cur);
if (cur->mIsRotated) {
Position rPosition = cur-><API key>;
rPosition = vecAdd(rPosition, p);
setDrawingRotationZ(cur->mRotationZ, rPosition);
}
if(cur->mIsScaled) {
Position sPosition = cur->mScaleEffectCenter;
sPosition = vecAdd(sPosition, p);
scaleDrawing3D(cur->mScale, sPosition);
}
if (cur->mHasBaseColor) {
<API key>(cur->mBaseColor.x, cur->mBaseColor.y, cur->mBaseColor.z);
}
if (cur->mHasTransparency) {
<API key>(cur->mTransparency);
}
Rectangle texturePos = cur->mTexturePosition;
if(cur->mInversionState.x) {
Position center = vecAdd(cur->mCenter, p);
double deltaX = center.x - p.x;
double nRightX = center.x + deltaX;
double nLeftX = nRightX - abs(cur->mTexturePosition.bottomRight.x - cur->mTexturePosition.topLeft.x);
p.x = nLeftX;
texturePos.topLeft.x = cur->mTexturePosition.bottomRight.x;
texturePos.bottomRight.x = cur->mTexturePosition.topLeft.x;
}
if (cur->mInversionState.y) {
Position center = vecAdd(cur->mCenter, p);
double deltaY = center.y - p.y;
double nDownY = center.y + deltaY;
double nUpY = nDownY - abs(cur->mTexturePosition.bottomRight.y - cur->mTexturePosition.topLeft.y);
p.y = nUpY;
texturePos.topLeft.y = cur->mTexturePosition.bottomRight.y;
texturePos.bottomRight.y = cur->mTexturePosition.topLeft.y;
}
drawSprite(cur->mTextureData[frame], p, texturePos);
if(cur->mIsScaled || cur->mIsRotated || cur->mHasBaseColor || cur->mHasTransparency) {
<API key>();
}
}
void <API key>() {
stl_int_map_map(gAnimationHandler.mList, <API key>);
}
static void <API key>(){
gAnimationHandler.mList.clear();
}
static <API key>* <API key>(const Position& tPosition, TextureData* tTextures, const Animation& tAnimation, const Rectangle& tTexturePosition, AnimationPlayerCB tOptionalCB, void* tCaller, int tIsLooped){
<API key> e;
e.mCaller = tCaller;
e.mCB = tOptionalCB;
e.mIsLooped = tIsLooped;
e.mPosition = tPosition;
e.mTexturePosition = tTexturePosition;
e.mTextureData = tTextures;
e.mAnimation = tAnimation;
e.<API key> = NULL;
e.<API key> = NULL;
e.mIsScaled = 0;
e.mIsRotated = 0;
e.mHasBaseColor = 0;
e.mHasTransparency = 0;
e.mCenter = Vector3D(0,0,0);
e.mInversionState = Vector3DI(0,0,0);
e.mIsVisible = 1;
int id = <API key>(gAnimationHandler.mList, e);
auto& element = gAnimationHandler.mList[id];
element.mID = id;
return &element;
}
<API key>* playAnimation(const Position& tPosition, TextureData* tTextures, const Animation& tAnimation, const Rectangle& tTexturePosition, AnimationPlayerCB tOptionalCB, void* tCaller){
return <API key>(tPosition, tTextures, tAnimation, tTexturePosition, tOptionalCB, tCaller, 0);
}
<API key>* playAnimationLoop(const Position& tPosition, TextureData* tTextures, const Animation& tAnimation, const Rectangle& tTexturePosition){
return <API key>(tPosition, tTextures, tAnimation, tTexturePosition, NULL, NULL, 1);
}
<API key>* <API key>(const Position& tPosition, TextureData* tTextures) {
Animation anim = <API key>();
Rectangle rect = <API key>(tTextures[0]);
return playAnimationLoop(tPosition, tTextures, anim, rect);
}
void changeAnimation(<API key>* e, TextureData* tTextures, const Animation& tAnimation, const Rectangle& tTexturePosition) {
e->mTexturePosition = tTexturePosition;
e->mTextureData = tTextures;
e->mAnimation = tAnimation;
}
void <API key>(<API key>* e, Position* <API key>) {
e-><API key> = <API key>;
}
void <API key>(<API key>* e, Position* <API key>) {
e-><API key> = <API key>;
}
void setAnimationScale(<API key>* e, const Vector3D& tScale, const Position& tCenter) {
e->mIsScaled = 1;
e->mScaleEffectCenter = tCenter;
e->mScale = tScale;
}
void setAnimationSize(<API key>* e, const Vector3D& tSize, const Position& tCenter) {
e->mIsScaled = 1;
e->mScaleEffectCenter = tCenter;
double dx = tSize.x / e->mTextureData[0].mTextureSize.x;
double dy = tSize.y / e->mTextureData[0].mTextureSize.y;
e->mScale = Vector3D(dx, dy, 1);
}
static void <API key>(<API key>* e, double tAngle, const Vector3D& tCenter) {
e->mIsRotated = 1;
e-><API key> = tCenter;
e->mRotationZ = tAngle;
}
void <API key>(<API key>* e, double tAngle, const Position& tCenter) {
<API key>(e, tAngle, tCenter);
}
static void <API key>(<API key>* e, double r, double g, double b) {
e->mHasBaseColor = 1;
e->mBaseColor = Vector3D(r, g, b);
}
void setAnimationColor(<API key>* e, double r, double g, double b) {
<API key>(e, r, g, b);
}
void <API key>(<API key>* e, Color tColor)
{
double r, g, b;
getRGBFromColor(tColor, &r, &g, &b);
setAnimationColor(e, r, g, b);
}
void <API key>(<API key>* e, double a) {
e->mHasTransparency = 1;
e->mTransparency = a;
}
void <API key>(<API key>* e, int tIsVisible)
{
e->mIsVisible = tIsVisible;
}
void setAnimationCenter(<API key>* e, const Position& tCenter) {
e->mCenter = tCenter;
}
void setAnimationCB(<API key>* e, AnimationPlayerCB tCB, void* tCaller) {
e->mCB = tCB;
e->mCaller = tCaller;
}
void <API key>(<API key>* e, const Position& tPosition) {
e->mPosition = tPosition;
}
void <API key>(<API key>* e, const Rectangle& tTexturePosition)
{
e->mTexturePosition = tTexturePosition;
}
void setAnimationLoop(<API key>* e, int tIsLooping) {
e->mIsLooped = tIsLooping;
}
void removeAnimationCB(<API key>* e) {
setAnimationCB(e, NULL, NULL);
}
typedef struct {
<API key>* mElement;
Vector3D mColor;
Duration mDuration;
} <API key>;
static void <API key>(void* tCaller) {
<API key>* e = (<API key>*)tCaller;
e->mColor = vecAdd(e->mColor, Vector3D(1.0 / e->mDuration, 1.0 / e->mDuration, 1.0 / e->mDuration));
if (e->mColor.x >= 1) e->mColor = Vector3D(1, 1, 1);
setAnimationColor(e->mElement, e->mColor.x, e->mColor.y, e->mColor.z);
if (e->mColor.x >= 1) { freeMemory(e); }
else addTimerCB(0,<API key>, e);
}
void fadeInAnimation(<API key>* tElement, Duration tDuration) {
<API key>* e = (<API key>*)allocMemory(sizeof(<API key>));
e->mElement = tElement;
e->mColor = Vector3D(0, 0, 0);
e->mDuration = tDuration;
addTimerCB(0, <API key>, e);
setAnimationColor(tElement, e->mColor.x, e->mColor.y, e->mColor.z);
}
void <API key>(<API key>* e) {
e->mInversionState.x ^= 1;
}
void <API key>(<API key>* e) {
e->mInversionState.y ^= 1;
}
void <API key>(<API key>* e, int tValue) {
e->mInversionState.x = tValue;
}
void <API key>(<API key>* e, int tValue) {
e->mInversionState.y = tValue;
}
typedef struct {
double mAngle;
Vector3D mCenter;
} ScreenRotationZ;
static void <API key>(ScreenRotationZ* tRot, <API key>& tData) {
<API key>* e = &tData;
const auto p = <API key>(e);
const auto center = vecSub(tRot->mCenter, p);
<API key>(e, tRot->mAngle, center);
}
void <API key>(double tAngle, const Vector3D& tCenter)
{
ScreenRotationZ rot;
rot.mAngle = tAngle;
rot.mCenter = tCenter;
stl_int_map_map(gAnimationHandler.mList, <API key>, &rot);
}
typedef struct {
double r;
double g;
double b;
} <API key>;
static void <API key>(<API key>* tTint, <API key>& tData) {
<API key>* e = &tData;
<API key>(e, tTint->r, tTint->g, tTint->b);
}
void <API key>(double r, double g, double b)
{
<API key> tint;
tint.r = r;
tint.g = g;
tint.b = b;
stl_int_map_map(gAnimationHandler.mList, <API key>, &tint);
}
void <API key>()
{
<API key>(1, 1, 1);
}
double* <API key>(<API key>* e)
{
return &e->mTransparency;
}
Position* <API key>(<API key>* e) {
return &e->mPosition;
}
void <API key>(<API key>* e) {
gAnimationHandler.mList.erase(e->mID);
}
int isHandledAnimation(<API key>* e) {
return stl_map_contains(gAnimationHandler.mList, e->mID);
}
void <API key>(){
<API key>();
gAnimationHandler.mList.clear();
gAnimationHandler.mIsLoaded = 0;
}
|
define(['Core', 'Core/Renderer', 'BackBone'], function (Core, Renderer, Backbone) {
'use strict';
var HiddenView = Backbone.View.extend({
initialize: function (template, formTag, element) {
this.el = formTag;
this.template = template;
this.element = element;
this.bindEvents();
},
bindEvents: function () {
var self = this;
Core.Mediator.subscribe('before:form:submit', function (form) {
if (form.attr('id') === self.el) {
var element = form.find('.element_' + self.element.getKey()),
input = element.find('input[name="' + self.element.getKey() + '"]'),
span = element.find('span.updated'),
oldValue = self.element.value;
if (input.val() !== oldValue) {
span.text('updated');
} else {
span.text('');
}
}
});
},
/**
* Render the template into the DOM with the Renderer
* @returns {String} html
*/
render: function () {
return Renderer.render(this.template, {element: this.element});
}
});
return HiddenView;
});
|
#include "rw_snippet.h"
#include <QXmlStreamWriter>
#include <QBuffer>
#include <QDebug>
#include <QModelIndex>
#include <QMetaEnum>
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <<API key>>
#include <QNetworkReply>
#include <QCoreApplication>
#include "datafield.h"
#include "rw_domain.h"
#include "rw_facet.h"
static QMetaEnum snip_type_enum = QMetaEnum::fromType<RWFacet::SnippetType>();
static QMetaEnum snip_veracity_enum = QMetaEnum::fromType<RWContentsItem::SnippetVeracity>();
static QMetaEnum snip_style_enum = QMetaEnum::fromType<RWContentsItem::SnippetStyle>();
static QMetaEnum snip_purpose_enum = QMetaEnum::fromType<RWContentsItem::SnippetPurpose>();
const int NAME_TYPE_LENGTH = 50;
const QString DEFAULT_IMAGE_NAME("image.png");
const char *<API key> = "PNG";
#define CONTENTS_TOKEN "contents"
RWSnippet::RWSnippet(RWFacet *facet, RWContentsItem *parent) :
RWContentsItem(facet, parent),
facet(facet)
{
}
static QString to_gregorian(const QString &from)
{
// TODO - Realm Works does not like "gregorian" fields in this format!
/* Must be [Y]YYYY-MM-DD hh:mm:ss[ BCE]
* year limit is 20000 */
if (from.length() >= 19) return from;
// If no time in the field, then simply append midnight time */
if (from.length() == 10 || from.length() == 11) return from + " 00:00:00";
qWarning() << "INVALID DATE FORMAT:" << from << "(should be [Y]YYYY-MM-DD HH:MM:SS)";
return from;
}
void RWSnippet::writeToContents(QXmlStreamWriter *writer, const QModelIndex &index) const
{
Q_UNUSED(index);
bool bold = false;
// Ignore date snippets if no data available
const QString start_date = startDate().valueString(index);
if ((facet->snippetType() == RWFacet::Date_Game || facet->snippetType() == RWFacet::Date_Range) && start_date.isEmpty())
{
return;
}
writer->writeStartElement("snippet");
{
const QString user_text = contentsText().valueString(index);
const QString gm_dir = gmDirections().valueString(index);
const QVariant asset = filename().value(index);
const QString finish_date = finishDate().valueString(index);
QString digits = number().valueString(index);
if (!structure->id().isEmpty()) writer->writeAttribute("facet_id", structure->id());
writer->writeAttribute("type", snip_type_enum.valueToKey(facet->snippetType()));
if (snippetVeracity() != RWContentsItem::Truth) writer->writeAttribute("veracity", snip_veracity_enum.valueToKey(snippetVeracity()));
if (snippetStyle() != RWContentsItem::Normal) writer->writeAttribute("style", snip_style_enum.valueToKey(snippetStyle()));
if (snippetPurpose() != RWContentsItem::Story_Only) writer->writeAttribute("purpose", snip_purpose_enum.valueToKey(snippetPurpose()));
if (isRevealed()) writer->writeAttribute("is_revealed", "true");
if (!gm_dir.isEmpty())
{
RWFacet::SnippetType ft = facet->snippetType();
writer->writeAttribute("purpose",
((ft == RWFacet::Multi_Line || ft == RWFacet::Labeled_Text ||
ft == RWFacet::Tag_Standard ||
ft == RWFacet::Numeric) && user_text.isEmpty() && p_tags.valueString(index).isEmpty()) ? "Directions_Only" : "Both");
}
#if 0
QString label_text = p_label_text.valueString(index);
if (id().isEmpty() && facet->snippetType() == Labeled_Text && !label_text.isEmpty())
{
// For locally added snippets of the Labeled_Text variety
writer->writeAttribute("label", label_text);
}
#endif
// CHILDREN have to be in a specific order:
// contents | smart_image | ext_object | game_date | date_range
// annotation
// gm_directions
// X x (link | dlink)
// X x tag_assign
// Maybe an ANNOTATION or CONTENTS
if (!user_text.isEmpty() || !asset.isNull() || !start_date.isEmpty() || !digits.isEmpty())
{
bool check_annotation = true;
switch (facet->snippetType())
{
case RWFacet::Multi_Line:
case RWFacet::Labeled_Text:
{
QString text;
for (auto para: user_text.split("\n\n"))
text.append(xmlParagraph(xmlSpan(para, bold)));
writer->writeTextElement(CONTENTS_TOKEN, text);
// No annotation for these two snippet types
check_annotation = false;
break;
}
case RWFacet::Tag_Standard:
case RWFacet::Hybrid_Tag:
// annotation done later
break;
case RWFacet::Numeric:
if (!digits.isEmpty())
{
bool ok;
#if 1
digits.toFloat(&ok);
if (!ok)
qWarning() << tr("Non-numeric characters in numeric field: %1").arg(digits);
else
writer->writeTextElement(CONTENTS_TOKEN, digits);
#else
const QLocale &locale = QLocale::system();
locale.toFloat(digits, &ok);
if (!ok)
qWarning() << tr("Non-numeric characters in numeric field: %1").arg(digits);
else
{
// Handle locale details:
// Remove occurrences of the group character;
// Replace the locale's decimal point with the ISO '.' character
digits.remove(locale.groupSeparator());
digits.replace(locale.decimalPoint(),'.');
writer->writeTextElement(CONTENTS_TOKEN, digits);
}
#endif
}
break;
// There are a lot of snippet types which have an ext_object child (which has an asset child)
case RWFacet::Foreign:
write_ext_object(writer, "Foreign", asset);
break;
case RWFacet::Statblock: // this might require an .rtf file?
write_ext_object(writer, "Statblock", asset);
break;
case RWFacet::Portfolio: // requires a HeroLab portfolio
write_ext_object(writer, "Portfolio", asset);
break;
case RWFacet::Picture:
write_ext_object(writer, "Picture", asset);
break;
case RWFacet::Rich_Text:
write_ext_object(writer, "Rich_Text", asset);
break;
case RWFacet::PDF:
write_ext_object(writer, "PDF", asset);
break;
case RWFacet::Audio:
write_ext_object(writer, "Audio", asset);
break;
case RWFacet::Video:
write_ext_object(writer, "Video", asset);
break;
case RWFacet::HTML:
write_ext_object(writer, "HTML", asset);
break;
case RWFacet::Smart_Image:
// Slightly different format since it has a smart_image child (which has an asset child)
write_smart_image(writer, asset);
break;
case RWFacet::Date_Game:
writer->writeStartElement("game_date");
//writer->writeAttribute("canonical", start_date);
writer->writeAttribute("gregorian", to_gregorian(start_date));
writer->writeEndElement();
break;
case RWFacet::Date_Range:
writer->writeStartElement("date_range");
//writer->writeAttribute("canonical_start", start_date);
writer->writeAttribute("gregorian_start", to_gregorian(start_date));
//writer->writeAttribute("canonical_end", finish_date);
writer->writeAttribute("gregorian_end", to_gregorian(finish_date));
writer->writeEndElement();
break;
case RWFacet::Tag_Multi_Domain:
qFatal("RWSnippet::writeToContents: invalid snippet type: %d", facet->snippetType());
} /* switch snippet type */
if (check_annotation && !user_text.isEmpty())
{
writer->writeTextElement("annotation", xmlParagraph(xmlSpan(user_text, /*bold*/ false)));
}
}
// Maybe some GM directions
if (!gm_dir.isEmpty())
{
writer->writeTextElement("gm_directions", xmlParagraph(xmlSpan(gm_dir, /*bold*/ false)));
}
// Maybe one or more TAG_ASSIGN (to be entered AFTER the contents/annotation)
QString tag_names = p_tags.valueString(index);
if (!tag_names.isEmpty())
{
// Find the domain to use
QString domain_id = structure->attributes().value("domain_id").toString();
RWDomain *domain = RWDomain::getDomainById(domain_id);
if (domain)
{
for (auto tag_name: tag_names.split(","))
{
QString tag_id = domain->tagId(tag_name.trimmed());
if (!tag_id.isEmpty())
{
writer->writeStartElement("tag_assign");
writer->writeAttribute("tag_id", tag_id);
writer->writeAttribute("type","Indirect");
writer->writeAttribute("is_auto_assign", "true");
writer->writeEndElement();
}
else
qWarning() << "No TAG defined for" << tag_name.trimmed() << "in DOMAIN" << domain->name();
}
}
else if (!domain_id.isEmpty())
qWarning() << "DOMAIN not found for" << domain_id << "on FACET" << structure->id();
else
qWarning() << "domain_id does not exist on FACET" << structure->id();
}
}
writer->writeEndElement(); // snippet
}
void RWSnippet::write_asset(QXmlStreamWriter *writer, const QVariant &asset) const
{
const int <API key> = 200;
// Images can be put inside immediately
if (asset.type() == QVariant::Image)
{
QImage image = asset.value<QImage>();
writer->writeStartElement("asset");
writer->writeAttribute("filename", DEFAULT_IMAGE_NAME.right(<API key>));
QByteArray databytes;
QBuffer buffer(&databytes);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, <API key>);
writer->writeTextElement(CONTENTS_TOKEN, databytes.toBase64());
writer->writeEndElement(); // asset
return;
}
QFile file(asset.toString());
QUrl url(asset.toString());
if (file.open(QFile::ReadOnly))
{
QFileInfo info(file);
writer->writeStartElement("asset");
writer->writeAttribute("filename", info.fileName().right(<API key>));
//writer->writeAttribute("thumbnail_size", info.fileName());
QByteArray contents = file.readAll();
writer->writeTextElement(CONTENTS_TOKEN, contents.toBase64());
//writer->writeTextElement("thumbnail", thumbnail.toBase64());
//writer->writeTextElement("summary", thing.toBase64());
//writer->writeTextElement("url", filename);
writer->writeEndElement(); // asset
}
else if (url.isValid())
{
static <API key> *nam = nullptr;
if (nam == nullptr)
{
nam = new <API key>;
nam->setRedirectPolicy(QNetworkRequest::<API key>);
}
QNetworkRequest request(url);
QNetworkReply *reply = nam->get(request);
while (!reply->isFinished())
{
qApp->processEvents(QEventLoop::WaitForMoreEvents);
}
if (reply->error() != QNetworkReply::NoError)
{
qWarning() << "Failed to locate URL:" << asset.toString();
}
// A redirect has ContentType of "text/html; charset=UTF-8, image/png"
// which is an ordered comma-separated list of types.
// So we need to check the LAST type which will be for readAll()
else if (reply->header(QNetworkRequest::ContentTypeHeader).toString().split(',').last().trimmed().startsWith("image/"))
{
QString tempname = QFileInfo(url.path()).baseName() + '.' + reply->header(QNetworkRequest::ContentTypeHeader).toString().split("/").last();
writer->writeStartElement("asset");
writer->writeAttribute("filename", tempname.right(<API key>));
QByteArray contents = reply->readAll();
writer->writeTextElement(CONTENTS_TOKEN, contents.toBase64());
//writer->writeTextElement("url", filename);
writer->writeEndElement(); // asset
}
else
{
// A redirect has QPair("Content-Type","text/html; charset=UTF-8, image/png")
// the body of the message is actually PNG binary data.
// QPair("Server","Microsoft-IIS/8.5, Microsoft-IIS/8.5") so maybe ISS sent wrong content type
qWarning() << "Only URLs to images are supported (not" << reply->header(QNetworkRequest::ContentTypeHeader) << ")! Check source at" << asset.toString();
//if (reply->header(QNetworkRequest::ContentTypeHeader).toString().startsWith("text/"))
// qWarning() << "Body =" << reply->readAll();
//qWarning() << "Raw Header List =" << reply->rawHeaderPairs();
}
reply->deleteLater();
}
else
{
#if 1
qWarning() << "File/URL does not exist:" + asset.toString();
#else
QString message = "File/URL does not exist: " + asset.toString();
static QMessageBox *warning = nullptr;
if (warning == nullptr)
{
warning = new QMessageBox;
warning->setText("Issues encountered during GENERATE:\n");
}
warning->setText(warning->text() + '\n' + message);
warning->show();
#endif
}
}
/**
* @brief RWSnippet::write_ext_object
* @param writer
* @param exttype one of Foreign, Statblock, Portfolio, Picture, Rich_Text, PDF, Audio, Video, HTML
* @param filename
*/
void RWSnippet::write_ext_object(QXmlStreamWriter *writer, const QString &exttype, const QVariant &asset) const
{
if (asset.isNull()) return;
writer->writeStartElement("ext_object");
if (asset.type() == QVariant::String)
writer->writeAttribute("name", QFileInfo(asset.toString()).fileName().right(NAME_TYPE_LENGTH));
else
// What name to use for QImage?
writer->writeAttribute("name", DEFAULT_IMAGE_NAME.right(NAME_TYPE_LENGTH));
writer->writeAttribute("type", exttype);
write_asset(writer, asset);
writer->writeEndElement();
}
void RWSnippet::write_smart_image(QXmlStreamWriter *writer, const QVariant &asset) const
{
if (asset.isNull()) return;
writer->writeStartElement("smart_image");
writer->writeAttribute("name", QFileInfo(asset.toString()).fileName().right(NAME_TYPE_LENGTH));
write_asset(writer, asset);
// write_overlay (0-1)
// write_subset_mask (0-1)
// write_superset_mask (0-1)
// write_map_pan (0+)
writer->writeEndElement();
}
QDataStream &operator<<(QDataStream &stream, const RWSnippet &snippet)
{
//qDebug() << " RWSnippet<<" << snippet.structure->name();
// write base class items
stream << *dynamic_cast<const RWContentsItem*>(&snippet);
// write this class items
stream << snippet.p_tags;
stream << snippet.p_label_text;
stream << snippet.p_filename;
stream << snippet.p_start_date;
stream << snippet.p_finish_date;
stream << snippet.p_number;
return stream;
}
QDataStream &operator>>(QDataStream &stream, RWSnippet &snippet)
{
//qDebug() << " RWSnippet>>" << snippet.structure->name();
// read base class items
stream >> *dynamic_cast<RWContentsItem*>(&snippet);
// read this class items
stream >> snippet.p_tags;
stream >> snippet.p_label_text;
stream >> snippet.p_filename;
stream >> snippet.p_start_date;
stream >> snippet.p_finish_date;
stream >> snippet.p_number;
return stream;
}
|
#include "podcastclient.h"
QStringList PodcastClient::<API key>()
{
QStringList resultList = settings.value("feeds").toStringList();
if(resultList.isEmpty())
{
QString string = settings.value("feeds").toString();
if(!string.isEmpty())
resultList.push_back(string);
}
return resultList;
}
PodcastClient::PodcastClient(QObject *parent) : QObject(parent)
{
if(settings.value("NumDownloads").isNull())
settings.setValue("NumDownloads",10);
if(settings.value("Dest").isNull())
settings.setValue("Dest",".");
else
{
if(!QDir(settings.value("Dest").toString()).exists())
{
settings.setValue("Dest",",");
}
}
downloader.setMaxConnections(settings.value("NumDownloads").toInt());
foreach(QString url, <API key>())
{
Podcast* podcast = new Podcast(QUrl(url), &downloader, this);
podcast->setTargetFolder(QDir(settings.value("Dest").toString()));
podcasts.push_back(podcast);
connect(podcast,&Podcast::done,this,&PodcastClient::podcastDone);
connect(podcast,&Podcast::writingFailed,this,&PodcastClient::<API key>);
}
}
bool PodcastClient::downloadAll()
{
if(podcasts.isEmpty())
{
out << "No podcasts in list. Done." << endl;
return true;
}
finishedCtr = 0;
foreach(Podcast* podcast, podcasts)
{
podcast->update();
}
return false;
}
bool PodcastClient::addPodcast(const QUrl &url, const QString &mode)
{
podcasts.clear();
finishedCtr = 0;
if(!url.isValid())
{
out << "Invalid URL." << endl;
return true;
}
if(mode=="last" || mode.isEmpty())
{
Podcast* podcast = new Podcast(url, &downloader, this);
podcasts.push_back(podcast);
connect(podcast,&Podcast::done,this,&PodcastClient::podcastDone);
podcast->init(true);
QStringList feeds;
foreach(QString url, <API key>())
{
feeds.push_back(url);
}
feeds.push_back(url.toString());
settings.setValue("feeds",feeds);
return false;
}
else if(mode=="all")
{
QStringList feeds;
foreach(QString url, <API key>())
{
feeds.push_back(url);
}
feeds.push_back(url.toString());
settings.setValue("feeds",feeds);
return true;
}
else if(mode=="none")
{
Podcast* podcast = new Podcast(url, &downloader, this);
podcasts.push_back(podcast);
connect(podcast,&Podcast::done,this,&PodcastClient::podcastDone);
podcast->init(false);
QStringList feeds;
foreach(QString url, <API key>())
{
feeds.push_back(url);
}
feeds.push_back(url.toString());
settings.setValue("feeds",feeds);
return false;
}
else
{
out << "Invalid adding mode: " << mode << endl;
out << "Modes are: last, all, none" << endl;
return true;
}
}
void PodcastClient::removePodcast(const QUrl &url)
{
QStringList feeds;
foreach(QString url, <API key>())
{
feeds.push_back(url);
}
feeds.removeAll(url.toString());
if(feeds.isEmpty())
settings.remove("feeds");
else
settings.setValue("feeds",feeds);
}
void PodcastClient::setDest(const QString &dest)
{
QDir dir(dest);
settings.setValue("Dest",dest);
settings.sync();
if(!dir.exists())
{
out << "Target directory does not exist." << endl;
}
}
QString PodcastClient::getDest()
{
return settings.value("Dest").toString();
}
void PodcastClient::list()
{
foreach(QString url, <API key>())
{
out << url << endl;
}
}
void PodcastClient::setMaxDownloads(int num)
{
downloader.setMaxConnections(num);
settings.setValue("NumDownloads",num);
settings.sync();
}
int PodcastClient::getMaxDownloads()
{
return downloader.getMaxConnections();
}
void PodcastClient::podcastDone()
{
finishedCtr++;
if(finishedCtr==podcasts.size())
{
settings.sync();
QCoreApplication::exit(0);
}
}
void PodcastClient::<API key>()
{
out << "Aborting downloads..." << endl;
foreach(Podcast* podcast, podcasts)
{
podcast->abort();
}
}
|
package org.epilot.ccf.codec;
import org.apache.mina.common.ByteBuffer;
import org.epilot.ccf.core.code.<API key>;
import org.epilot.ccf.core.protocol.Message;
import org.epilot.ccf.core.protocol.MessageBody;
import org.epilot.ccf.core.protocol.MessageHeader;
import org.epilot.ccf.core.util.<API key>;
public class MessageEncode extends <API key> {
private String serviceName;
public MessageEncode(String serviceName) {
this.serviceName = serviceName;
}
protected void encodeMessage(<API key> messageDataHandle,Message message,ByteBuffer buffer) {
<API key> <API key> =new <API key>(buffer);
MessageHeader header = message.getHeader();
MessageBody body = message.getBody();
if(header ==null)
{
return;
}
messageDataHandle.getHeaderBuffer(serviceName,header, <API key>);
if(body !=null)
{
messageDataHandle.getBodyBuffer(String.valueOf(header.getProtocolId()),body, <API key>);
}
}
@Override
protected void encodeMessage(<API key> messageDataHandle,
Message message, ByteBuffer buffer) {
}
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http:
<html>
<head>
<title>Description of create_links_stl</title>
<meta name="keywords" content="create_links_stl">
<meta name="description" content="%%%%%%%%%%%%%%%%%">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 © 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../../../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../../../index.html">Home</a> > <a href="../../../index.html">arte3.1.4</a> > <a href="#">robots</a> > <a href="#">MITSUBISHI</a> > <a href="index.html">PA-10</a> > create_links_stl.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../../../../index.html"><img alt="<" border="0" src="../../../../left.png"> Master index</a></td>
<td align="right"><a href="index.html">Index for arte3.1.4/robots/MITSUBISHI/PA-10 <img alt=">" border="0" src="../../../../right.png"></a></td></tr></table>
<h1>create_links_stl
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2>
<div class="box"><strong>%%%%%%%%%%%%%%%%%</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2>
<div class="box"><strong>This is a script file. </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2>
<div class="fragment"><pre class="comment">%%%%%%%%%%%%%%%%%
LINK 0: BASE
%%%%%%%%%%%%%%%%%</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../../../matlabicon.gif)">
<li><a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a> SURF2STL Write STL file from surface data.</li></ul>
This function is called by:
<ul style="list-style-image:url(../../../../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2>
<div class="fragment"><pre>0001 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0002 <span class="comment">% LINK 0: BASE</span>
0003 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0004 filename=<span class="string">'link0.stl'</span>; <span class="comment">%base</span>
0005 cyl_radius=0.075;
0006 cyl_height = 0.290;
0007 precision = 10; <span class="comment">% increase to obtain a more accurate drawing</span>
0008
0009 <span class="comment">%create a unit height cylinder with 100 points. Radius 75</span>
0010 [X,Y,Z] = cylinder([cyl_radius], precision);
0011 <span class="comment">%Multiply Z by height</span>
0012 Z=Z*cyl_height;
0013
0014 <span class="comment">%Save in stl format, create new file</span>
0015 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0016
0017 <span class="comment">%now create a disk, bottom</span>
0018 radius = linspace(0,cyl_radius,precision); <span class="comment">% For ten rings</span>
0019 theta = (pi/180)*[0:15:360]; <span class="comment">% For eight angles</span>
0020 [R,T] = meshgrid(radius,theta); <span class="comment">% Make radius/theta grid</span>
0021 X = R.*cos(T); <span class="comment">% Convert grid to cartesian coordintes</span>
0022 Y = R.*sin(T);
0023
0024 <span class="comment">%append this solid to already created file, bottom disk</span>
0025 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, 0.*X, <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0026 <span class="comment">%top disk</span>
0027 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, cyl_height.*ones(size(X,1), size(X,2)), <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0028
0029
0030 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0031 <span class="comment">% LINK 1</span>
0032 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0033 filename=<span class="string">'link1.stl'</span>;
0034 cyl_radius=0.05;
0035 cyl_height = 0.150;
0036
0037 <span class="comment">%create a unit height cylinder with 100 points. Radius 75</span>
0038 [X,Y,Z] = cylinder([cyl_radius], precision);
0039 <span class="comment">% draw Z correspondingly</span>
0040 Z(1,:)=Z(1,:) -cyl_height/2;
0041 Z(2,:)=Z(2,:).*(cyl_height/2);
0042
0043 <span class="comment">%Save in stl format, create new file</span>
0044 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0045
0046 <span class="comment">%now create a disk, bottom</span>
0047 radius = linspace(0,cyl_radius,precision); <span class="comment">% For ten rings</span>
0048 theta = (pi/180)*[0:15:360]; <span class="comment">% For eight angles</span>
0049 [R,T] = meshgrid(radius,theta); <span class="comment">% Make radius/theta grid</span>
0050 X = R.*cos(T); <span class="comment">% Convert grid to cartesian coordintes</span>
0051 Y = R.*sin(T);
0052
0053 <span class="comment">%append this solid to already created file, bottom disk</span>
0054 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, (-cyl_height/2).*ones(size(X,1), size(X,2)), <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0055 <span class="comment">%top disk</span>
0056 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, (cyl_height/2).*ones(size(X,1), size(X,2)), <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0057
0058
0059 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0060 <span class="comment">% LINK 2</span>
0061 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0062 filename=<span class="string">'link2.stl'</span>;
0063 <span class="comment">%cylinder 1</span>
0064 cyl_radius=0.03;
0065 cyl_height = 0.1;
0066 [X,Y,Z] = cylinder([cyl_radius], precision);
0067 <span class="comment">% draw Z correspondingly</span>
0068 Z(1,:)=Z(1,:) -cyl_height/2;
0069 Z(2,:)=Z(2,:).*(cyl_height/2);
0070
0071 <span class="comment">%Save in stl format, create new file</span>
0072 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0073
0074 cyl_radius=0.05;
0075 cyl_height = 0.450;
0076 <span class="comment">%draw arm, swap X and Z</span>
0077 [Z,Y,X] = cylinder([cyl_radius cyl_radius*0.8], precision);
0078 <span class="comment">% draw Z correspondingly</span>
0079 X(1,:)=X(1,:) -cyl_height;
0080 X(2,:)=X(2,:).*0;
0081
0082 <span class="comment">%surf(X, Y, Z)</span>
0083
0084 <span class="comment">%Save in stl format, create new file</span>
0085 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0086
0087
0088
0089 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0090 <span class="comment">% LINK 3</span>
0091 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0092 filename=<span class="string">'link3.stl'</span>;
0093 <span class="comment">%cylinder 1</span>
0094 <span class="comment">% cyl_radius=0.03;</span>
0095 <span class="comment">% cyl_height = 0.1;</span>
0096 <span class="comment">% [X,Y,Z] = cylinder([cyl_radius], precision);</span>
0097 <span class="comment">% % draw Z correspondingly</span>
0098 <span class="comment">% Z(1,:)=Z(1,:) -cyl_height/2;</span>
0099 <span class="comment">% Z(2,:)=Z(2,:).*(cyl_height/2);</span>
0100 <span class="comment">%</span>
0101 <span class="comment">% %Save in stl format, create new file</span>
0102 <span class="comment">% surf2stl(filename, X, Y, Z, 'ascii', 'w');</span>
0103
0104 cyl_radius=0.04;
0105 cyl_height = 0.50;
0106 <span class="comment">%draw arm, swap X and Z</span>
0107 [X, Y, Z] = cylinder([cyl_radius cyl_radius*0.8], precision);
0108 <span class="comment">% draw Z correspondingly</span>
0109
0110 Z(2,:)=Z(2,:).*(cyl_height);
0111
0112 <span class="comment">%Save in stl format, create new file</span>
0113 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0114
0115
0116 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0117 <span class="comment">% LINK 4</span>
0118 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0119 filename=<span class="string">'link4.stl'</span>;
0120
0121 cyl_radius=0.03;
0122 cyl_height = 0.07;
0123 <span class="comment">%draw arm, swap X and Z</span>
0124 [X, Y, Z] = cylinder([cyl_radius], precision);
0125 <span class="comment">% draw Z correspondingly</span>
0126 Z(1,:)=Z(1,:) -cyl_height/2;
0127 Z(2,:)=Z(2,:).*(cyl_height/2);
0128
0129 <span class="comment">%Save in stl format, create new file</span>
0130 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0131
0132
0133
0134 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0135 <span class="comment">% LINK 5</span>
0136 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0137 filename=<span class="string">'link5.stl'</span>;
0138
0139 cyl_radius=0.03;
0140 cyl_height = 0.07;
0141 <span class="comment">%draw arm, swap X and Z</span>
0142 [X, Y, Z] = cylinder([cyl_radius], precision);
0143 <span class="comment">% draw Z correspondingly</span>
0144 Z(2,:)=Z(2,:).*(cyl_height);
0145
0146 <span class="comment">%Save in stl format, create new file</span>
0147 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0148
0149
0150
0151 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0152 <span class="comment">% LINK 6</span>
0153 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
0154 filename=<span class="string">'link6.stl'</span>;
0155
0156 cyl_radius=0.05;
0157 cyl_height = 0.01;
0158 <span class="comment">%draw arm, swap X and Z</span>
0159 [X, Y, Z] = cylinder([cyl_radius], precision);
0160 <span class="comment">% draw Z correspondingly</span>
0161 Z(1,:)=Z(1,:) -cyl_height;
0162 Z(2,:)=Z(2,:).*0;
0163 <span class="comment">%Save in stl format, create new file</span>
0164 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, Z, <span class="string">'ascii'</span>, <span class="string">'w'</span>);
0165
0166 <span class="comment">%now create a disk, bottom</span>
0167 radius = linspace(0,cyl_radius,precision);
0168 theta = (pi/180)*[0:15:360];
0169 [R,T] = meshgrid(radius,theta); <span class="comment">% Make radius/theta grid</span>
0170 X = R.*cos(T);
0171 Y = R.*sin(T);
0172
0173 <span class="comment">%append this solid to already created file, bottom disk</span>
0174 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, (-cyl_height).*ones(size(X,1), size(X,2)), <span class="string">'ascii'</span>, <span class="string">'a+'</span>);
0175 <span class="comment">%append this solid to already created file, bottom disk</span>
0176 <a href="../../../../arte3.1.4/tools/surf2stl/surf2stl.html" class="code" title="function surf2stl(filename,x,y,z,mode,writemode)">surf2stl</a>(filename, X, Y, 0.*ones(size(X,1), size(X,2)), <span class="string">'ascii'</span>, <span class="string">'a+'</span>);</pre></div>
<hr><address>Generated on Wed 29-May-2013 19:30:18 by <strong><a href="http:
</body>
</html>
|
var <API key> =
[
[ "IXNAnnotationFormat", "<API key>.html#<API key>", [
[ "<API key>", "<API key>.html#<API key>", null ],
[ "<API key>", "<API key>.html#<API key>", null ],
[ "<API key>", "<API key>.html#<API key>", null ]
] ]
];
|
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Controls.Navigation/1.3.1/Transition.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Int.h>
namespace g{
namespace Fuse{
namespace Triggers{
// public enum TransitionMode :181
uEnumType* <API key>();
}}} // ::g::Fuse::Triggers
|
#include <unistd.h>
#include <sys/stat.h>
int remove(const char *pathname) {
struct stat buf;
stat(pathname, &buf);
if (S_ISDIR(buf.st_mode)) {
return rmdir(pathname);
} else {
return unlink(pathname);
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Dal.SOFD
{
public interface IRepo<IEntity>
{
IQueryable<IEntity> Query { get; }
}
}
|
package com.baeldung.iteratorguide;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public class IteratorGuide {
public static void main(String[] args) {
List<String> items = new ArrayList<>();
items.add("ONE");
items.add("TWO");
items.add("THREE");
Iterator<String> iter = items.iterator();
while (iter.hasNext()) {
String next = iter.next();
System.out.println(next);
iter.remove();
}
ListIterator<String> listIterator = items.listIterator();
while(listIterator.hasNext()) {
String nextWithIndex = items.get(listIterator.nextIndex());
String next = listIterator.next();
if( "ONE".equals(next)) {
listIterator.set("SWAPPED");
}
}
listIterator.add("FOUR");
while(listIterator.hasPrevious()) {
String previousWithIndex = items.get(listIterator.previousIndex());
String previous = listIterator.previous();
System.out.println(previous);
}
listIterator.forEachRemaining(e -> {
System.out.println(e);
});
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SPCtoMML
{
public partial class Form2 : Form
{
<summary>
Callback for updating progress
</summary>
private Func<double> <API key>;
<summary>
Initializes the form.
</summary>
<param name="updateProgress">The callback for updating progress bar ratio.</param>
public Form2(Func<double> updateProgress)
{
InitializeComponent();
this.Text = Program.GetProgramName();
this.<API key> = updateProgress;
}
public void UpdateHandler(Func<double> updateProgress)
{
this.<API key> = updateProgress;
}
<summary>
Updates the progress dialog status.
</summary>
<param name="status">The new status to use.</param>
public void UpdateStatus(string status)
{
this.label1.Text = status;
}
<summary>
Updates the progress bar.
</summary>
<param name="ratio">The progress ratio.</param>
public void UpdateProgress(double ratio)
{
try
{
this.progressBar1.Value = (int)Math.Round(ratio * 1000);
}
catch
{
this.progressBar1.Value = 0;
}
}
private void Form2_FormClosing(object sender, <API key> e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (<API key> != null)
{
UpdateProgress(<API key>());
}
}
}
}
|
#ifndef <API key>
#define <API key>
#include <map>
#include <memory>
#include <string>
#include "<API key>.h"
class StringConverter;
/*!
* \brief This class is an implementation of the interface <API key>.
*
* This implementation accepts configuration parameters upon instantiation and
* it is intended to be used in unit testing.
*/
class <API key> : public <API key>
{
public:
<API key>();
virtual ~<API key>();
std::string property(std::string property_name, std::string default_value);
bool property(std::string property_name, bool default_value);
long property(std::string property_name, long default_value);
int property(std::string property_name, int default_value);
unsigned int property(std::string property_name, unsigned int default_value);
float property(std::string property_name, float default_value);
double property(std::string property_name, double default_value);
void set_property(std::string property_name, std::string value);
bool is_present(std::string property_name);
private:
std::map<std::string, std::string> properties_;
std::unique_ptr<StringConverter> converter_;
};
#endif /*<API key>*/
|
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('<API key>').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.setLogLevel('WARN')
if len(sys.argv) > 5:
if sys.argv[5] == "hive":
sqlContext = HiveContext(sc)
else:
sqlContext = SQLContext(sc)
hdfs = sys.argv[3]
dbname = sys.argv[4]
etl_date = sys.argv[1]
#etl
V_DT = etl_date
V_DT_LD = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8])) + timedelta(-1)).strftime("%Y%m%d")
V_DT_FMD = date(int(etl_date[0:4]), int(etl_date[4:6]), 1).strftime("%Y%m%d")
V_DT_LMD = (date(int(etl_date[0:4]), int(etl_date[4:6]), 1) + timedelta(-1)).strftime("%Y%m%d")
V_DT10 = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8]))).strftime("%Y-%m-%d")
V_STEP = 0
sql = """
SELECT CAST(A.CUST_ID AS VARCHAR(32)) AS CUST_ID
,CAST('' AS VARCHAR(20)) AS ORG_ID --2017/05/13
,CAST('D002015' AS VARCHAR(20)) AS INDEX_CODE
,CAST(SUM(TAKE_CGT_LINE) AS DECIMAL(22,2)) AS INDEX_VALUE
,CAST(SUBSTR(V_DT, 1, 7) AS VARCHAR(7)) AS YEAR_MONTH
,CAST(V_DT AS DATE) AS ETL_DATE
,CAST(A.CUST_TYP AS VARCHAR(5)) AS CUST_TYPE
,CAST(A.FR_ID AS VARCHAR(5)) AS FR_ID
FROM <API key> A
WHERE A.BAL > 0
AND A.LN_APCL_FLG = 'N'
AND(A.PRODUCT_ID LIKE '1010%'
OR A.PRODUCT_ID LIKE '1030%'
OR A.PRODUCT_ID LIKE '1040%'
OR A.PRODUCT_ID LIKE '1050%'
OR A.PRODUCT_ID LIKE '1060%'
OR A.PRODUCT_ID LIKE '1070%'
OR A.PRODUCT_ID LIKE '2010%'
OR A.PRODUCT_ID LIKE '2020%'
OR A.PRODUCT_ID LIKE '2030%'
OR A.PRODUCT_ID LIKE '2040%'
OR A.PRODUCT_ID LIKE '2050%')
GROUP BY A.CUST_ID
,A.CUST_TYP
,A.FR_ID """
|
/* File: <API key>.h */
/* Purpose: Header file for <API key>.c. */
/* References: [1] - "Bayesian data analysis and parameter inference and */
/* applications to imaging based on photon counting", */
/* ACC Coolen, KCL, December 8th 2006. */
/* Notes: None. */
/* Revision history: */
/* Date | Modification */
/* 090424 | Creation, mrowley. */
#ifndef <API key>
#define <API key>
int <API key>( int *data,
int nbins,
int fitstart,
int nphotons,
double *w0,
double *w1,
float *val,
BayesInstrRsp_t *instr,
float interval,
float modulationperiod,
float alpha,
<API key> *grid,
BayesAveErrDistn_t *distr);
int <API key>( int *data,
int nbins,
int fitstart,
int nphotons,
double *w0_mp,
double *w1_mp,
double *w0_ave,
double *w1_ave,
double *dw0,
double *dw1,
BayesInstrRsp_t *instr,
float interval,
float modulationperiod,
float alpha,
float precision,
int p,/* hmm, this is actually nphotons */
int quick,
BayesAveErrDistn_t *distr,
<API key> *grid,
float *value);
#if 0
int <API key>( int *data,
int nbins,
int nphotons,
float *w0,
float *w1,
//float *val,
float delay,
float width,
float interval,
float modulationperiod,
float alpha,
<API key> *grid);
#endif
#endif /* <API key> */
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>SUMO - Simulation of Urban MObility: <API key>.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="../../main.html"><span>Main Page</span></a></li>
<li><a href="../../pages.html"><span>Related Pages</span></a></li>
<li><a href="../../modules.html"><span>Modules</span></a></li>
<li><a href="../../annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
<li><a href="../../dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="../../files.html"><span>File List</span></a></li>
<li><a href="../../globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="../../<API key>.html">home</a> » <a class="el" href="../../<API key>.html">boni</a> » <a class="el" href="../../<API key>.html">Desktop</a> » <a class="el" href="../../<API key>.html">DanielTouched</a> » <a class="el" href="../../<API key>.html">sumo-0.14.0</a> » <a class="el" href="../../<API key>.html">src</a> » <a class="el" href="../../<API key>.html">netbuild</a>
</div>
</div>
<div class="contents">
<h1><API key>.h File Reference</h1><code>#include <<a class="el" href="../../db/d16/config_8h_source.html">config.h</a>></code><br/>
<code>#include <map></code><br/>
<code>#include <string></code><br/>
<code>#include "<a class="el" href="../../dc/da1/<API key>.html"><API key>.h</a>"</code><br/>
<p><a href="../../d3/dd9/<API key>.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5e/<API key>.html"><API key></a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">A container for traffic light definitions and built programs. <a href="../../d9/d5e/<API key>.html#_details">More...</a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<dl class="author"><dt><b>Author:</b></dt><dd>Daniel Krajzewicz </dd>
<dd>
Jakob Erdmann </dd>
<dd>
Michael Behrisch </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>Sept 2002 </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd></dd></dl>
<dl class="rcs"><dt><b>Id</b></dt><dd><a class="el" href="../../d3/dd9/<API key>.html"><API key>.h</a> 11671 2012-01-07 20:14:30Z behrisch </dd></dl>
<p>Definition in file <a class="el" href="../../d3/dd9/<API key>.html"><API key>.h</a>.</p>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 17 12:16:15 2012 for SUMO - Simulation of Urban MObility by
<a href="http:
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
|
/*
ID: zhou.yo1
PROG: palsquare
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
const char* digits = "<API key>";
void to_base( int num, int base, char* out )
{
char* p = out;
while( num )
{
*p++ = digits[ num % base ];
num /= base;
}
*p = '\0';
reverse( out, p );
//cout << out << endl;
}
bool is_pal( char* in, int len )
{
for(int i = 0; i < len/2; ++i )
{
if( in[i] != in[len-1-i] ) return false;
}
return true;
}
int main()
{
ifstream fin( "palsquare.in" );
ofstream out( "palsquare.out" );
int base;
fin >> base;
char N[256];
char S[256];
for(int i = 1; i <= 300; ++i )
{
to_base(i, base, N);
to_base(i*i, base, S);
if( is_pal(S, strlen(S)) )
{
out << N << ' ' << S << endl;
}
}
return 0;
}
|
{% extends "base.html" %}
{% block content %}
<p>
<h2>What is NLGIS?</h2>
In the nineteenth century there were more than 800 municipalities in the Netherlands, where today only about 450 remain. The NLGIS (Netherlands Geographic Information System) project is an effort to plot data for these municipalities on historically accurate municipality <a href="/site?code=TXGE&year=1986">boundaries</a> for the period 1812 - 1997.
</p>
<table border=0 valign=top width="100%">
<tr>
<td width="48%">
<h2>Key Features</h2>
The project's aim is twofold: to allow non-GIS experts to easily plot data on historical maps and to disseminate information on the maps and the underlying data from the Historical Database of Dutch Municipalities (HDNG). We do so in the following manner:
<li>Upload your own datasets and visualize the data on historically accurate map boundaries</li>
<li>Get access to the map of Netherlands on the <a href="/site?code=TXGE&year=1982&province=Noord-Holland">provincial level</a></li>
<li>Download the map in Vector (<a href="/download?year=1982&province=&code=TXGE&format=SVG">SVG</a>, <a href="/download?year=1982&province=&code=TXGE&format=shapefile">ShapeFile</a>) or Raster quality (<a href="/download?year=1982&code=TXGE">PNG</a>, <a href="/download?year=1982&province=&code=TXGE&format=PDF">PDF</a>)</li>
<li>Integrate the map with your data with popular public map services like Google Maps or Leaflet</li>
<li>Use NLGIS <a href="/developers">public Data and Geo APIs</a> and shapefiles to build your own map visualization</li>
<li>Customize your map selecting projection, colormap, data categories, number of colors, etc</li>
<li>Use <a href="/index">NLGIS datasets</a> free of charge to do your own research</li>
<table>
<tr>
<td><br/><a href="https://iisg.amsterdam"><img src="/static/socialhistory.png"></a></td>
</tr>
</table>
</td>
<td width=2%"></td>
<td width="50%">
<p>
<a href="/site?year=1889&code=VIB1"><img width=300px height=400px src="/static/map1.png"></a>
<a href="/site?code=TXGE&year=1982"><img width=300px height=400px src="/static/map2.png"></a>
</td>
</tr>
</table>
{% endblock %}
|
<div class='fossil-doc' data-title='fileutil - file utilities'>
<style>
HTML {
background: #FFFFFF;
color: black;
}
BODY {
background: #FFFFFF;
color: black;
}
DIV.doctools {
margin-left: 10%;
margin-right: 10%;
}
DIV.doctools H1,DIV.doctools H2 {
margin-left: -5%;
}
H1, H2, H3, H4 {
margin-top: 1em;
font-family: sans-serif;
font-size: large;
color: #005A9C;
background: transparent;
text-align: left;
}
H1.doctools_title {
text-align: center;
}
UL,OL {
margin-right: 0em;
margin-top: 3pt;
margin-bottom: 3pt;
}
UL LI {
list-style: disc;
}
OL LI {
list-style: decimal;
}
DT {
padding-top: 1ex;
}
UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
font: normal 12pt/14pt sans-serif;
list-style: none;
}
LI.doctools_section, LI.doctools_subsection {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
PRE {
display: block;
font-family: monospace;
white-space: pre;
margin: 0%;
padding-top: 0.5ex;
padding-bottom: 0.5ex;
padding-left: 1ex;
padding-right: 1ex;
width: 100%;
}
PRE.doctools_example {
color: black;
background: #f5dcb3;
border: 1px solid black;
}
UL.<API key> LI, UL.doctools_syntax LI {
list-style: none;
margin-left: 0em;
text-indent: 0em;
padding: 0em;
}
DIV.doctools_synopsis {
color: black;
background: #80ffff;
border: 1px solid black;
font-family: serif;
margin-top: 1em;
margin-bottom: 1em;
}
UL.doctools_syntax {
margin-top: 1em;
border-top: 1px solid black;
}
UL.<API key> {
margin-bottom: 1em;
border-bottom: 1px solid black;
}
</style>
<hr> [
<a href="../../../../toc.html">Main Table Of Contents</a>
| <a href="../../../toc.html">Table Of Contents</a>
| <a href="../../../../index.html">Keyword Index</a>
| <a href="../../../../toc0.html">Categories</a>
| <a href="../../../../toc1.html">Modules</a>
| <a href="../../../../toc2.html">Applications</a>
] <hr>
<div class="doctools">
<h1 class="doctools_title">fileutil(n) 1.15 tcllib "file utilities"</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>fileutil - Procedures implementing some file utilities</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Warnings and Incompatibilities</a></li>
<li class="doctools_section"><a href="#section3">Bugs, Ideas, Feedback</a></li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#category">Category</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="<API key>">
<li>package require <b class="pkgname">Tcl 8</b></li>
<li>package require <b class="pkgname">fileutil <span class="opt">?1.15?</span></b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="cmd">::fileutil::lexnormalize</b> <i class="arg">path</i></a></li>
<li><a href="#2"><b class="cmd">::fileutil::fullnormalize</b> <i class="arg">path</i></a></li>
<li><a href="#3"><b class="cmd">::fileutil::test</b> <i class="arg">path</i> <i class="arg">codes</i> <span class="opt">?<i class="arg">msgvar</i>?</span> <span class="opt">?<i class="arg">label</i>?</span></a></li>
<li><a href="#4"><b class="cmd">::fileutil::cat</b> (<span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i>)...</a></li>
<li><a href="#5"><b class="cmd">::fileutil::writeFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">data</i></a></li>
<li><a href="#6"><b class="cmd">::fileutil::appendToFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">data</i></a></li>
<li><a href="#7"><b class="cmd">::fileutil::insertIntoFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">data</i></a></li>
<li><a href="#8"><b class="cmd">::fileutil::removeFromFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">n</i></a></li>
<li><a href="#9"><b class="cmd">::fileutil::replaceInFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">n</i> <i class="arg">data</i></a></li>
<li><a href="#10"><b class="cmd">::fileutil::updateInPlace</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">cmd</i></a></li>
<li><a href="#11"><b class="cmd">::fileutil::fileType</b> <i class="arg">filename</i></a></li>
<li><a href="#12"><b class="cmd">::fileutil::find</b> <span class="opt">?<i class="arg">basedir</i> <span class="opt">?<i class="arg">filtercmd</i>?</span>?</span></a></li>
<li><a href="#13"><b class="cmd">::fileutil::findByPattern</b> <i class="arg">basedir</i> <span class="opt">?<b class="option">-regexp</b>|<b class="option">-glob</b>?</span> <span class="opt">?<b class="option">--</b>?</span> <i class="arg">patterns</i></a></li>
<li><a href="#14"><b class="cmd">::fileutil::foreachLine</b> <i class="arg">var filename cmd</i></a></li>
<li><a href="#15"><b class="cmd">::fileutil::grep</b> <i class="arg">pattern</i> <span class="opt">?<i class="arg">files</i>?</span></a></li>
<li><a href="#16"><b class="cmd">::fileutil::install</b> <span class="opt">?<b class="option">-m</b> <i class="arg">mode</i>?</span> <i class="arg">source</i> <i class="arg">destination</i></a></li>
<li><a href="#17"><b class="cmd">::fileutil::stripN</b> <i class="arg">path</i> <i class="arg">n</i></a></li>
<li><a href="#18"><b class="cmd">::fileutil::stripPwd</b> <i class="arg">path</i></a></li>
<li><a href="#19"><b class="cmd">::fileutil::stripPath</b> <i class="arg">prefix</i> <i class="arg">path</i></a></li>
<li><a href="#20"><b class="cmd">::fileutil::jail</b> <i class="arg">jail</i> <i class="arg">path</i></a></li>
<li><a href="#21"><b class="cmd">::fileutil::touch</b> <span class="opt">?<b class="option">-a</b>?</span> <span class="opt">?<b class="option">-c</b>?</span> <span class="opt">?<b class="option">-m</b>?</span> <span class="opt">?<b class="option">-r</b> <i class="arg">ref_file</i>?</span> <span class="opt">?<b class="option">-t</b> <i class="arg">time</i>?</span> <i class="arg">filename</i> <span class="opt">?<i class="arg">...</i>?</span></a></li>
<li><a href="#22"><b class="cmd">::fileutil::tempdir</b></a></li>
<li><a href="#23"><b class="cmd">::fileutil::tempdir</b> <i class="arg">path</i></a></li>
<li><a href="#24"><b class="cmd">::fileutil::tempdirReset</b></a></li>
<li><a href="#25"><b class="cmd">::fileutil::tempfile</b> <span class="opt">?<i class="arg">prefix</i>?</span></a></li>
<li><a href="#26"><b class="cmd">::fileutil::maketempdir</b> <span class="opt">?<b class="option">-prefix</b> <i class="arg">str</i>?</span> <span class="opt">?<b class="option">-suffix</b> <i class="arg">str</i>?</span> <span class="opt">?<b class="option">-dir</b> <i class="arg">str</i>?</span></a></li>
<li><a href="#27"><b class="cmd">::fileutil::relative</b> <i class="arg">base</i> <i class="arg">dst</i></a></li>
<li><a href="#28"><b class="cmd">::fileutil::relativeUrl</b> <i class="arg">base</i> <i class="arg">dst</i></a></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>This package provides implementations of standard unix utilities.</p>
<dl class="<API key>">
<dt><a name="1"><b class="cmd">::fileutil::lexnormalize</b> <i class="arg">path</i></a></dt>
<dd><p>This command performs purely lexical normalization on the <i class="arg">path</i> and returns
the changed path as its result. Symbolic links in the path are <em>not</em> resolved.</p>
<p>Examples:</p>
<pre class="doctools_example">
fileutil::lexnormalize /foo/./bar
=> /foo/bar
fileutil::lexnormalize /foo/../bar
=> /bar
</pre>
</dd>
<dt><a name="2"><b class="cmd">::fileutil::fullnormalize</b> <i class="arg">path</i></a></dt>
<dd><p>This command resolves all symbolic links in the <i class="arg">path</i> and returns
the changed path as its result.
In contrast to the builtin <b class="cmd">file normalize</b> this command
resolves a symbolic link in the last element of the path as well.</p></dd>
<dt><a name="3"><b class="cmd">::fileutil::test</b> <i class="arg">path</i> <i class="arg">codes</i> <span class="opt">?<i class="arg">msgvar</i>?</span> <span class="opt">?<i class="arg">label</i>?</span></a></dt>
<dd><p>A command for the testing of several properties of a <i class="arg">path</i>. The
properties to test for are specified in <i class="arg">codes</i>, either as a list
of keywords describing the properties, or as a string where each
letter is a shorthand for a property to test. The recognized keywords,
shorthands, and associated properties are shown in the list below. The
tests are executed in the order given to the command.</p>
<p>The result of the command is a boolean value. It will be true if and
only if the <i class="arg">path</i> passes all the specified tests.
In the case of the <i class="arg">path</i> not passing one or more test the first
failing test will leave a message in the variable referenced by
<i class="arg">msgvar</i>, if such is specified. The message will be prefixed with
<i class="arg">label</i>, if it is specified.
<em>Note</em> that the variabled referenced by <i class="arg">msgvar</i> is not touched at
all if all the tests pass.</p>
<dl class="<API key>">
<dt><em>r</em>ead</dt>
<dd><p><b class="cmd">file readable</b></p></dd>
<dt><em>w</em>rite</dt>
<dd><p><b class="cmd">file writable</b></p></dd>
<dt><em>e</em>xists</dt>
<dd><p><b class="cmd">file exists</b></p></dd>
<dt>e<em>x</em>ec</dt>
<dd><p><b class="cmd">file executable</b></p></dd>
<dt><em>f</em>ile</dt>
<dd><p><b class="cmd">file isfile</b></p></dd>
<dt><em>d</em>ir</dt>
<dd><p><b class="cmd">file isdirectory</b></p></dd>
</dl></dd>
<dt><a name="4"><b class="cmd">::fileutil::cat</b> (<span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i>)...</a></dt>
<dd><p>A tcl implementation of the UNIX <b class="syscmd"><a href="../../../../index.html#key314">cat</a></b> command. Returns the
contents of the specified file(s). The arguments are files to read,
with interspersed options configuring the process. If there are
problems reading any of the files, an error will occur, and no data
will be returned.</p>
<p>The options accepted are <b class="option">-encoding</b>, <b class="option">-translation</b>,
<b class="option">-eofchar</b>, and <b class="option">--</b>. With the exception of the last all
options take a single value as argument, as specified by the tcl
builtin command <b class="cmd">fconfigure</b>. The <b class="option">--</b> has to be used to
terminate option processing before a file if that file's name begins
with a dash.</p>
<p>Each file can have its own set of options coming before it, and for
anything not specified directly the defaults are inherited from the
options of the previous file. The first file inherits the system
default for unspecified options.</p></dd>
<dt><a name="5"><b class="cmd">::fileutil::writeFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">data</i></a></dt>
<dd><p>The command replaces the current contents of the specified <i class="arg">file</i>
with <i class="arg">data</i>, with the process configured by the options. The
command accepts the same options as <b class="cmd">::fileutil::cat</b>. The
specification of a non-existent file is legal and causes the command
to create the file (and all required but missing directories).</p></dd>
<dt><a name="6"><b class="cmd">::fileutil::appendToFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">data</i></a></dt>
<dd><p>This command is like <b class="cmd">::fileutil::writeFile</b>, except that the
previous contents of <i class="arg">file</i> are not replaced, but appended to. The
command accepts the same options as <b class="cmd">::fileutil::cat</b></p></dd>
<dt><a name="7"><b class="cmd">::fileutil::insertIntoFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">data</i></a></dt>
<dd><p>This comment is similar to <b class="cmd">::fileutil::appendToFile</b>, except that
the new data is not appended at the end, but inserted at a specified
location within the file. In further contrast this command has to be
given the path to an existing file. It will not create a missing file,
but throw an error instead.</p>
<p>The specified location <i class="arg">at</i> has to be an integer number in the
range <b class="const">0</b> ... [file size <i class="arg">file</i>]. <b class="const">0</b> will cause
insertion of the new data before the first character of the existing
content, whereas [file size <i class="arg">file</i>] causes insertion after
the last character of the existing content, i.e. appending.</p>
<p>The command accepts the same options as <b class="cmd">::fileutil::cat</b>.</p></dd>
<dt><a name="8"><b class="cmd">::fileutil::removeFromFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">n</i></a></dt>
<dd><p>This command is the complement to <b class="cmd">::fileutil::insertIntoFile</b>, removing <i class="arg">n</i> characters from the <i class="arg">file</i>, starting at location <i class="arg">at</i>.
The specified location <i class="arg">at</i> has to be an integer number in the
range <b class="const">0</b> ... [file size <i class="arg">file</i>] - <i class="arg">n</i>. <b class="const">0</b>
will cause the removal of the new data to start with the first
character of the existing content,
whereas [file size <i class="arg">file</i>] - <i class="arg">n</i> causes the removal of
the tail of the existing content, i.e. the truncation of the file.</p>
<p>The command accepts the same options as <b class="cmd">::fileutil::cat</b>.</p></dd>
<dt><a name="9"><b class="cmd">::fileutil::replaceInFile</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">at</i> <i class="arg">n</i> <i class="arg">data</i></a></dt>
<dd><p>This command is a combination of <b class="cmd">::fileutil::removeFromFile</b> and
<b class="cmd">::fileutil::insertIntoFile</b>. It first removes the part of the
contents specified by the arguments <i class="arg">at</i> and <i class="arg">n</i>, and then
inserts <i class="arg">data</i> at the given location, effectively replacing the
removed by content with <i class="arg">data</i>.
All constraints imposed on <i class="arg">at</i> and <i class="arg">n</i> by
<b class="cmd">::fileutil::removeFromFile</b> and <b class="cmd">::fileutil::insertIntoFile</b>
are obeyed.</p>
<p>The command accepts the same options as <b class="cmd">::fileutil::cat</b>.</p></dd>
<dt><a name="10"><b class="cmd">::fileutil::updateInPlace</b> <span class="opt">?<i class="arg">options</i>?</span> <i class="arg">file</i> <i class="arg">cmd</i></a></dt>
<dd><p>This command can be seen as the generic core functionality of
<b class="cmd">::fileutil::replaceInFile</b>.
It first reads the contents of the specified <i class="arg">file</i>, then runs the
command prefix <i class="arg">cmd</i> with that data appended to it, and at last
writes the result of that invokation back as the new contents of the
file.</p>
<p>If the executed command throws an error the <i class="arg">file</i> is not changed.</p>
<p>The command accepts the same options as <b class="cmd">::fileutil::cat</b>.</p></dd>
<dt><a name="11"><b class="cmd">::fileutil::fileType</b> <i class="arg">filename</i></a></dt>
<dd><p>An implementation of the UNIX <b class="syscmd"><a href="../../../../index.html#key31">file</a></b> command, which uses
various heuristics to guess the type of a file. Returns a list
specifying as much type information as can be determined about the
file, from most general (eg, "binary" or "text") to most specific (eg,
"gif"). For example, the return value for a GIF file would be "binary
graphic gif". The command will detect the following types of files:
directory, empty, binary, text, script (with interpreter), executable
elf, executable dos, executable ne, executable pe, graphic gif, graphic
jpeg, graphic png, graphic tiff, graphic bitmap, html, xml (with doctype
if available), message pgp, binary pdf, text ps, text eps, binary
<API key>, compressed bzip, compressed gzip, compressed
zip, compressed tar, audio wave, audio mpeg, and link. It further
detects doctools, doctoc, and docidx documentation files, and
tklib diagrams.</p></dd>
<dt><a name="12"><b class="cmd">::fileutil::find</b> <span class="opt">?<i class="arg">basedir</i> <span class="opt">?<i class="arg">filtercmd</i>?</span>?</span></a></dt>
<dd><p>An implementation of the unix command <b class="syscmd"><a href="../../../../index.html#key630">find</a></b>. Adapted from the
Tcler's Wiki. Takes at most two arguments, the path to the directory
to start searching from and a command to use to evaluate interest in
each file. The path defaults to "<b class="file">.</b>", i.e. the current
directory. The command defaults to the empty string, which means that
all files are of interest. The command takes care <em>not</em> to
lose itself in infinite loops upon encountering circular link
structures. The result of the command is a list containing the paths
to the interesting files.</p>
<p>The <i class="arg">filtercmd</i>, if specified, is interpreted as a command prefix
and one argument is added to it, the name of the file or directory
find is currently looking at. Note that this name is <em>not</em> fully
qualified. It has to be joined it with the result of <b class="cmd">pwd</b> to get
an absolute filename.</p>
<p>The result of <i class="arg">filtercmd</i> is a boolean value that indicates if the
current file should be included in the list of interesting files.</p>
<p>Example:</p>
<pre class="doctools_example">
# find .tcl files
package require fileutil
proc is_tcl {name} {return [string match *.tcl $name]}
set tcl_files [fileutil::find . is_tcl]
</pre>
</dd>
<dt><a name="13"><b class="cmd">::fileutil::findByPattern</b> <i class="arg">basedir</i> <span class="opt">?<b class="option">-regexp</b>|<b class="option">-glob</b>?</span> <span class="opt">?<b class="option">--</b>?</span> <i class="arg">patterns</i></a></dt>
<dd><p>This command is based upon the <b class="package">TclX</b> command
<b class="cmd">recursive_glob</b>, except that it doesn't allow recursion over more
than one directory at a time. It uses <b class="cmd">::fileutil::find</b>
internally and is thus able to and does follow symbolic links,
something the <b class="package">TclX</b> command does not do. First argument is
the directory to start the search in, second argument is a list of
<i class="arg">patterns</i>. The command returns a list of all files reachable
through <i class="arg">basedir</i> whose names match at least one of the
patterns. The options before the pattern-list determine the style of
matching, either regexp or glob. glob-style matching is the default if
no options are given. Usage of the option <b class="option">--</b> stops option
processing. This allows the use of a leading '-' in the patterns.</p></dd>
<dt><a name="14"><b class="cmd">::fileutil::foreachLine</b> <i class="arg">var filename cmd</i></a></dt>
<dd><p>The command reads the file <i class="arg">filename</i> and executes the script
<i class="arg">cmd</i> for every line in the file. During the execution of the
script the variable <i class="arg">var</i> is set to the contents of the current
line. The return value of this command is the result of the last
invocation of the script <i class="arg">cmd</i> or the empty string if the file was
empty.</p></dd>
<dt><a name="15"><b class="cmd">::fileutil::grep</b> <i class="arg">pattern</i> <span class="opt">?<i class="arg">files</i>?</span></a></dt>
<dd><p>Implementation of <b class="syscmd"><a href="../../../../index.html#key316">grep</a></b>. Adapted from the Tcler's Wiki. The
first argument defines the <i class="arg">pattern</i> to search for. This is
followed by a list of <i class="arg">files</i> to search through. The list is
optional and <b class="const">stdin</b> will be used if it is missing. The result
of the procedures is a list containing the matches. Each match is a
single element of the list and contains filename, number and contents
of the matching line, separated by a colons.</p></dd>
<dt><a name="16"><b class="cmd">::fileutil::install</b> <span class="opt">?<b class="option">-m</b> <i class="arg">mode</i>?</span> <i class="arg">source</i> <i class="arg">destination</i></a></dt>
<dd><p>The <b class="cmd">install</b> command is similar in functionality to the <b class="syscmd">install</b>
command found on many unix systems, or the shell script
distributed with many source distributions (unix/install-sh in the Tcl
sources, for example). It copies <i class="arg">source</i>, which can be either a
file or directory to <i class="arg">destination</i>, which should be a directory,
unless <i class="arg">source</i> is also a single file. The <span class="opt">?-m?</span> option lets
the user specify a unix-style mode (either octal or symbolic - see
<b class="cmd">file attributes</b>.</p></dd>
<dt><a name="17"><b class="cmd">::fileutil::stripN</b> <i class="arg">path</i> <i class="arg">n</i></a></dt>
<dd><p>Removes the first <i class="arg">n</i> elements from the specified <i class="arg">path</i> and
returns the modified path. If <i class="arg">n</i> is greater than the number of
components in <i class="arg">path</i> an empty string is returned. The number of
components in a given path may be determined by performing
<b class="cmd">llength</b> on the list returned by <b class="cmd">file split</b>.</p></dd>
<dt><a name="18"><b class="cmd">::fileutil::stripPwd</b> <i class="arg">path</i></a></dt>
<dd><p>If, and only if the <i class="arg">path</i> is inside of the directory returned by
[<b class="cmd">pwd</b>] (or the current working directory itself) it is made
relative to that directory. In other words, the current working
directory is stripped from the <i class="arg">path</i>. The possibly modified path
is returned as the result of the command. If the current working
directory itself was specified for <i class="arg">path</i> the result is the string
"<b class="const">.</b>".</p></dd>
<dt><a name="19"><b class="cmd">::fileutil::stripPath</b> <i class="arg">prefix</i> <i class="arg">path</i></a></dt>
<dd><p>If, and only of the <i class="arg">path</i> is inside of the directory
"<b class="file">prefix</b>" (or the prefix directory itself) it is made relative to
that directory. In other words, the prefix directory is stripped from
the <i class="arg">path</i>. The possibly modified path is returned as the result
of the command.
If the prefix directory itself was specified for <i class="arg">path</i> the result
is the string "<b class="const">.</b>".</p></dd>
<dt><a name="20"><b class="cmd">::fileutil::jail</b> <i class="arg">jail</i> <i class="arg">path</i></a></dt>
<dd><p>This command ensures that the <i class="arg">path</i> is not escaping the directory
<i class="arg">jail</i>. It always returns an absolute path derived from <i class="arg">path</i>
which is within <i class="arg">jail</i>.</p>
<p>If <i class="arg">path</i> is an absolute path and already within <i class="arg">jail</i> it is
returned unmodified.</p>
<p>An absolute path outside of <i class="arg">jail</i> is stripped of its root element
and then put into the <i class="arg">jail</i> by prefixing it with it. The same
happens if <i class="arg">path</i> is relative, except that nothing is stripped of
it. Before adding the <i class="arg">jail</i> prefix the <i class="arg">path</i> is lexically
normalized to prevent the caller from using <b class="const">..</b> segments in
<i class="arg">path</i> to escape the jail.</p></dd>
<dt><a name="21"><b class="cmd">::fileutil::touch</b> <span class="opt">?<b class="option">-a</b>?</span> <span class="opt">?<b class="option">-c</b>?</span> <span class="opt">?<b class="option">-m</b>?</span> <span class="opt">?<b class="option">-r</b> <i class="arg">ref_file</i>?</span> <span class="opt">?<b class="option">-t</b> <i class="arg">time</i>?</span> <i class="arg">filename</i> <span class="opt">?<i class="arg">...</i>?</span></a></dt>
<dd><p>Implementation of <b class="syscmd"><a href="../../../../index.html#key317">touch</a></b>. Alter the atime and mtime of the
specified files. If <b class="option">-c</b>, do not create files if they do not
already exist. If <b class="option">-r</b>, use the atime and mtime from
<i class="arg">ref_file</i>. If <b class="option">-t</b>, use the integer clock value
<i class="arg">time</i>. It is illegal to specify both <b class="option">-r</b> and
<b class="option">-t</b>. If <b class="option">-a</b>, only change the atime. If <b class="option">-m</b>,
only change the mtime.</p>
<p><em>This command is not available for Tcl versions less than 8.3.</em></p></dd>
<dt><a name="22"><b class="cmd">::fileutil::tempdir</b></a></dt>
<dd><p>The command returns the path of a directory where the caller can
place temporary files, such as "<b class="file">/tmp</b>" on Unix systems. The
algorithm we use to find the correct directory is as follows:</p>
<ol class="doctools_enumerated">
<li><p>The directory set by an invokation of <b class="cmd">::fileutil::tempdir</b> with
an argument. If this is present it is tried exclusively and none of
the following item are tried.</p></li>
<li><p>The directory named in the TMPDIR environment variable.</p></li>
<li><p>The directory named in the TEMP environment variable.</p></li>
<li><p>The directory named in the TMP environment variable.</p></li>
<li><p>A platform specific location:</p>
<dl class="<API key>">
<dt>Windows</dt>
<dd><p>"<b class="file">C:\TEMP</b>", "<b class="file">C:\TMP</b>", "<b class="file">\TEMP</b>",
and "<b class="file">\TMP</b>" are tried in that order.</p></dd>
<dt>(classic) Macintosh</dt>
<dd><p>The TRASH_FOLDER environment variable is used. This is most likely
not correct.</p></dd>
<dt>Unix</dt>
<dd><p>The directories "<b class="file">/tmp</b>", "<b class="file">/var/tmp</b>", and "<b class="file">/usr/tmp</b>" are
tried in that order.</p></dd>
</dl>
</li>
</ol>
<p>The algorithm utilized is mainly that used in the Python standard
library. The exception is the first item, the ability to have the
search overridden by a user-specified directory.</p></dd>
<dt><a name="23"><b class="cmd">::fileutil::tempdir</b> <i class="arg">path</i></a></dt>
<dd><p>In this mode the command sets the <i class="arg">path</i> as the first and only
directory to try as a temp. directory. See the previous item for the
use of the set directory. The command returns the empty string.</p></dd>
<dt><a name="24"><b class="cmd">::fileutil::tempdirReset</b></a></dt>
<dd><p>Invoking this command clears the information set by the
last call of [<b class="cmd">::fileutil::tempdir</b> <i class="arg">path</i>].
See the last item too.</p></dd>
<dt><a name="25"><b class="cmd">::fileutil::tempfile</b> <span class="opt">?<i class="arg">prefix</i>?</span></a></dt>
<dd><p>The command generates a temporary file name suitable for writing to,
and the associated file. The file name will be unique, and the file
will be writable and contained in the appropriate system specific temp
directory. The name of the file will be returned as the result of the
command.</p>
<p>The code was taken from <a href="http:
Igor Volobouev and anon.</p></dd>
<dt><a name="26"><b class="cmd">::fileutil::maketempdir</b> <span class="opt">?<b class="option">-prefix</b> <i class="arg">str</i>?</span> <span class="opt">?<b class="option">-suffix</b> <i class="arg">str</i>?</span> <span class="opt">?<b class="option">-dir</b> <i class="arg">str</i>?</span></a></dt>
<dd><p>The command generates a temporary directory suitable for writing to.
The directory name will be unique, and the directory will be writable
and contained in the appropriate system specific temp directory. The
name of the directory will be returned as the result of the command.</p>
<p>The three options can used to tweak the behaviour of the command:</p>
<dl class="doctools_options">
<dt><b class="option">-prefix</b> str</dt>
<dd><p>The initial, fixed part of the directory name. Defaults to <b class="const">tmp</b> if not specified.</p></dd>
<dt><b class="option">-suffix</b> str</dt>
<dd><p>The fixed tail of the directory. Defaults to the empty string if not specified.</p></dd>
<dt><b class="option">-dir</b> str</dt>
<dd><p>The directory to place the new directory into. Defaults to the result of <b class="cmd">fileutil::tempdir</b> if not specified.</p></dd>
</dl>
<p>The initial code for this was supplied by <a href="mailto:aplicacionamedida@gmail.com">Miguel Martinez Lopez</a>.</p></dd>
<dt><a name="27"><b class="cmd">::fileutil::relative</b> <i class="arg">base</i> <i class="arg">dst</i></a></dt>
<dd><p>This command takes two directory paths, both either absolute or relative
and computes the path of <i class="arg">dst</i> relative to <i class="arg">base</i>. This relative
path is returned as the result of the command. As implied in the previous
sentence, the command is not able to compute this relationship between the
arguments if one of the paths is absolute and the other relative.</p>
<p><em>Note:</em> The processing done by this command is purely lexical.
Symbolic links are <em>not</em> taken into account.</p></dd>
<dt><a name="28"><b class="cmd">::fileutil::relativeUrl</b> <i class="arg">base</i> <i class="arg">dst</i></a></dt>
<dd><p>This command takes two file paths, both either absolute or relative
and computes the path of <i class="arg">dst</i> relative to <i class="arg">base</i>, as seen
from inside of the <i class="arg">base</i>. This is the algorithm how a browser
resolves a relative link found in the currently shown file.</p>
<p>The computed relative path is returned as the result of the command.
As implied in the previous sentence, the command is not able to compute
this relationship between the arguments if one of the paths is absolute
and the other relative.</p>
<p><em>Note:</em> The processing done by this command is purely lexical.
Symbolic links are <em>not</em> taken into account.</p></dd>
</dl>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Warnings and Incompatibilities</a></h2>
<dl class="<API key>">
<dt><b class="const">1.14.9</b></dt>
<dd><p>In this version <b class="cmd">fileutil::find</b>'s broken system for handling
symlinks was replaced with one working correctly and properly
enumerating all the legal non-cyclic paths under a base directory.</p>
<p>While correct this means that certain pathological directory
hierarchies with cross-linked sym-links will now take about O(n**2)
time to enumerate whereas the original broken code managed O(n) due to
its brokenness.</p>
<p>A concrete example and extreme case is the "<b class="file">/sys</b>"
hierarchy under Linux where some hundred devices exist under both
"<b class="file">/sys/devices</b>" and "<b class="file">/sys/class</b>" with the two sub-hierarchies
linking to the other, generating millions of legal paths to enumerate.
The structure, reduced to three devices, roughly looks like</p>
<pre class="doctools_example">
/sys/class/tty/tty0 --> ../../dev/tty0
/sys/class/tty/tty1 --> ../../dev/tty1
/sys/class/tty/tty2 --> ../../dev/tty1
/sys/dev/tty0/bus
/sys/dev/tty0/subsystem --> ../../class/tty
/sys/dev/tty1/bus
/sys/dev/tty1/subsystem --> ../../class/tty
/sys/dev/tty2/bus
/sys/dev/tty2/subsystem --> ../../class/tty
</pre>
<p>The command <b class="cmd">fileutil::find</b> currently has no way to escape
this. When having to handle such a pathological hierarchy It is
recommended to switch to package <b class="package">fileutil::traverse</b> and the
same-named command it provides, and then use the <b class="option">-prefilter</b>
option to prevent the traverser from following symbolic links, like so:</p>
<pre class="doctools_example">
package require fileutil::traverse
proc NoLinks {fileName} {
if {[string equal [file type $fileName] link]} {
return 0
}
return 1
}
fileutil::traverse T /sys/devices -prefilter NoLinks
T foreach p {
puts $p
}
T destroy
</pre>
</dd>
</dl>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">Bugs, Ideas, Feedback</a></h2>
<p>This document, and the package it describes, will undoubtedly contain
bugs and other problems.
Please report such in the category <em>fileutil</em> of the
<a href="http://core.tcl.tk/tcllib/reportlist">Tcllib Trackers</a>.
Please also report any ideas for enhancements you may have for either
package and/or documentation.</p>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../../index.html#key314">cat</a>, <a href="../../../../index.html#key115">file utilities</a>, <a href="../../../../index.html#key316">grep</a>, <a href="../../../../index.html#key315">temp file</a>, <a href="../../../../index.html#key313">test</a>, <a href="../../../../index.html#key317">touch</a>, <a href="../../../../index.html#key117">type</a></p>
</div>
<div id="category" class="doctools_section"><h2><a name="category">Category</a></h2>
<p>Programming tools</p>
</div>
</div>
|
// Object: exported structs (needed for overriding api)
#pragma once
#include <windows.h>
#include "registers.h"
// assume that structs share between WinAPIOverride and the FakeAPI dll
// will have the same alignment
#pragma pack(push)
#pragma pack(4)
typedef struct <API key>
{
PBYTE Rbp;
PBYTE ReturnAddress;
HMODULE CallingModuleHandle;
BOOL <API key>;
}<API key>,*<API key>;
#pragma pack(pop)
#ifdef _WIN64
// StackParameters : adjusted stack parameters (no shadow for x64, only parameters passed through stack)
typedef BOOL (__stdcall *<API key>)(PBYTE StackParameters,REGISTERS* <API key>,XMM_REGISTERS* <API key>,<API key>* pHookInfos,PVOID UserParam);// return FALSE to stop pre api call chain functions
// StackParameters : adjusted stack parameters (no shadow for x64, only parameters passed through stack)
typedef BOOL (__stdcall *<API key>)(PBYTE StackParameters,REGISTERS* <API key>,XMM_REGISTERS* <API key>,REGISTERS* pAfterCallRegisters,XMM_REGISTERS* <API key>,<API key>* pHookInfos,PVOID UserParam);// return FALSE to stop calling post api call chain functions
#else
typedef BOOL (__stdcall *<API key>)(PBYTE StackParameters,REGISTERS* <API key>,<API key>* pHookInfos,PVOID UserParam);// return FALSE to stop pre api call chain functions
typedef BOOL (__stdcall *<API key>)(PBYTE StackParameters,REGISTERS* <API key>,REGISTERS* pAfterCallRegisters,<API key>* pHookInfos,PVOID UserParam);// return FALSE to stop calling post api call chain functions
#endif
typedef BOOL (__stdcall *<API key>)(CLSID* pClsid,IID* pIid,PVOID pInterface,<API key>* pHookInfos);// return FALSE to stop calling post api call chain functions
typedef BOOL (__stdcall *<API key>)(CLSID* pClsid,PVOID pIUnknownInterface,PVOID <API key>,<API key>* pHookInfos);// return FALSE to stop calling post api call chain functions
|
#ifndef PLANG_TOKENIZER
#define PLANG_TOKENIZER
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
class PlangTokenizer {
// Input buffer
std::string m_input;
// Current possition in input buffer
std::size_t m_input_pos;
// Currently read element from input
int m_ch;
// Counterss
int m_input_line; // Which line it is in the source code (0, 1,2,3...)
int m_input_column; // Which column it is in the source code (0, 1,2,3...)
// Simple input + counters initializer
void input_init() {
m_input.clear();
m_input_pos = 0;
// Counters
m_input_line = 0;
m_input_column = 0;
}
public:
// Return counter with current line
int get_line() {
return m_input_line;
}
// Return counter with current column
int get_column() {
return m_input_column;
}
// Returns nth line of input
std::string get_line_str(const int line) {
std::string::iterator b = m_input.begin();
std::string::iterator e = m_input.end();
for (int i = 0 ; i < line ; ++i) {
b = std::find(b, e, '\n');
}
return std::string(b, std::find(b, e, '\n'));
}
// Token values
struct TokenValue {
std::string s;
int i;
float f;
} m_token_value;
// Token types outputed by tokenizer
struct Token {
enum {
// Language values
END = -1, // EOF!
ID = -2,
INT = -3,
FLT = -4,
STR = -5,
// Language keywords
RETURN = -100,
IF = -200,
ELSE = -201,
AS = -202,
};
}; // Last read token
// Mapping between keyword and token
std::map<std::string, int> m_keyword_token_map = {
{"return", Token::RETURN},
{"if", Token::IF},
{"else", Token::ELSE},
{"as", Token::AS},
};
// Load all characters from input
void load_input(const char *input, int size) {
input_init();
m_input = std::string(input, input + size);
}
// Load from string input
void load_input(const char *input) {
input_init();
m_input = std::string(input);
}
// Return next element of input buffer
int get_next_consume() {
if (m_input_pos == m_input.size())
return Token::END;
return m_input[m_input_pos++];
}
// Get next element from the input and store it
// in m_ch temporary value buffer to use after call
int get_next() {
m_ch = get_next_consume();
// Collect some counter statistics
m_input_column++;
if (m_ch == '\n') {
m_input_column = 0;
m_input_line++;
}
return m_ch;
}
// Sneak-peak next token
int get_next_preview() {
if (m_input_pos == m_input.size())
return Token::END;
return m_input[m_input_pos];
}
// like isalpha checks if c is in set of allowed
// identifier charset
int isidchar(int c) {
return std::isalpha(c) || std::isdigit(c) || c == '_';
}
// Parse input and get next token
int get_token_val() {
while (std::isspace(get_next())) {
// Skipping all whitespaces
}
if (m_ch == Token::END)
return Token::END;
if (std::isalpha(m_ch)) {
// ID: alphanumeric
// KEYWORD: alphanumeric
m_token_value.s = m_ch;
while (isidchar(get_next_preview())) {
m_token_value.s += get_next();
}
// If identifier is a keyword return keyword token
if (m_keyword_token_map.find(m_token_value.s) != m_keyword_token_map.end()) {
return m_keyword_token_map.at(m_token_value.s);
}
// Generic identifier
return Token::ID;
} else if (std::isdigit(m_ch)) {
// INT: plain integer
m_token_value.s = m_ch;
while (std::isdigit(get_next_preview())) {
m_token_value.s += get_next();
}
m_token_value.i = std::atoi(m_token_value.s.c_str());
return Token::INT;
}
// Return read character
m_token_value.s = m_ch;
return m_ch;
}
// Get next token and saves int vaue in the buffer
int get_token() {
return get_token_val();
}
const TokenValue& get_token_value() {
return m_token_value;
}
};
#endif
|
// Noah Ablaseau <nablaseau@hotmail.com>
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
namespace linerider.IO.ffmpeg
{
public static class FFMPEG
{
private const int MaximumBuffers = 25;
private static bool inited = false;
public static bool HasExecutable
{
get
{
return File.Exists(ffmpeg_path);
}
}
public static string ffmpeg_dir
{
get
{
string dir = Program.UserDirectory + "ffmpeg" + Path.<API key>;
if (OpenTK.Configuration.RunningOnMacOS)
dir += "mac" + Path.<API key>;
else if (OpenTK.Configuration.RunningOnWindows)
dir += "win" + Path.<API key>;
else if (OpenTK.Configuration.RunningOnUnix)
{
dir += "linux" + Path.<API key>;
}
else
{
return null;
}
return dir;
}
}
public static string ffmpeg_path
{
get
{
var dir = ffmpeg_dir;
if (dir == null)
return null;
if (OpenTK.Configuration.RunningOnWindows)
return dir + "ffmpeg.exe";
else
return dir + "ffmpeg";
}
}
static FFMPEG()
{
}
private static void TryInitialize()
{
if (inited)
return;
inited = true;
if (ffmpeg_path == null)
throw new Exception("Unable to detect platform for ffmpeg");
<API key>();
}
public static string ConvertSongToOgg(string file, Func<string, bool> stdout)
{
TryInitialize();
if (!file.EndsWith(".ogg", true, Program.Culture))
{
var par = new IO.ffmpeg.FFMPEGParameters();
par.AddOption("i", "\"" + file + "\"");
par.OutputFilePath = file.Remove(file.IndexOf(".", StringComparison.Ordinal)) + ".ogg";
if (File.Exists(par.OutputFilePath))
{
if (File.Exists(file))
{
File.Delete(par.OutputFilePath);
}
else
{
return par.OutputFilePath;
}
}
Execute(par, stdout);
file = par.OutputFilePath;
}
return file;
}
public static void Execute(FFMPEGParameters parameters, Func<string, bool> stdout)
{
TryInitialize();
if (String.IsNullOrWhiteSpace(ffmpeg_path))
{
throw new Exception("Path to FFMPEG executable cannot be null");
}
if (parameters == null)
{
throw new Exception("FFMPEG parameters cannot be completely null");
}
using (Process ffmpegProcess = new Process())
{
ProcessStartInfo info = new ProcessStartInfo(ffmpeg_path)
{
Arguments = parameters.ToString(),
WorkingDirectory = Path.GetDirectoryName(ffmpeg_dir),
UseShellExecute = false,
CreateNoWindow = true,
<API key> = false,
<API key> = false
};
info.<API key> = true;
info.<API key> = true;
ffmpegProcess.StartInfo = info;
ffmpegProcess.Start();
if (stdout != null)
{
while (true)
{
string str = "";
try
{
str = ffmpegProcess.StandardError.ReadLine();
}
catch
{
Console.WriteLine("stdout log failed");
break;
//ignored
}
if (ffmpegProcess.HasExited)
break;
if (str == null)
str = "";
if (!stdout.Invoke(str))
{
ffmpegProcess.Kill();
return;
}
}
}
else
{
/*if (debug)
{
string processOutput = ffmpegProcess.StandardError.ReadToEnd();
}*/
ffmpegProcess.WaitForExit();
}
}
}
private static void <API key>()
{
if (OpenTK.Configuration.RunningOnUnix)
{
try
{
using (Process chmod = new Process())
{
ProcessStartInfo info = new ProcessStartInfo("/bin/chmod")
{
Arguments = "+x ffmpeg",
WorkingDirectory = Path.GetDirectoryName(ffmpeg_dir),
UseShellExecute = false,
};
chmod.StartInfo = info;
chmod.Start();
if (!chmod.WaitForExit(1000))
{
chmod.Close();
}
}
}
catch (Exception e)
{
linerider.Utils.ErrorLog.WriteLine(
"chmod error on ffmpeg" + Environment.NewLine + e.ToString());
}
}
}
}
}
|
Espo.define('Views.EmailAccount.Record.Edit', ['Views.Record.Edit', 'Views.EmailAccount.Record.Detail'], function (Dep, Detail) {
return Dep.extend({
afterRender: function () {
Dep.prototype.afterRender.call(this);
Detail.prototype.<API key>.call(this);
},
});
});
|
require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.<API key> = false
config.action_controller.perform_caching = true
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['<API key>'].present?
# Compress JavaScripts and CSS.
# config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Use a specific assets manifest file.
config.assets.manifest = "#{Rails.root}/config/manifest.json"
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use <API key>, and use secure cookies.
config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :request_id ]
# Use a different cache store in production.
config.cache_store = :memory_store
config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.<API key> = false
# Send email with Amazon Simple Email Service
config.action_mailer.delivery_method = :ses
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
# config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
# Do not dump schema after migrations.
config.active_record.<API key> = false
end
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
#pragma endregion
#include "../../drawing/drawing.h"
#include "../../interface/viewport.h"
#include "../../paint/map_element/map_element.h"
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../../sprites.h"
#include "../../world/map.h"
#include "../../world/sprite.h"
#include "../ride_data.h"
#include "../track_data.h"
#include "../track_paint.h"
/** rct2: 0x008A6370 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15006, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15007, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15008, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15009, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
static const uint32 imageIds[4][2] = {
{ 15016, <API key> },
{ 15017, <API key> },
{ 15016, <API key> },
{ 15017, <API key> },
};
sub_98197C_rotated(session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1,
height, 0, 6, height + 3);
sub_98196C_rotated(session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 32, 1,
height);
<API key>(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 0);
<API key>(session, rideIndex, trackSequence, direction, height, mapElement);
<API key>(session, direction, height, TUNNEL_6);
<API key>(session, SEGMENTS_ALL, 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6380 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15060, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15061, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15062, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15063, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15032, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15033, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15034, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15035, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6390 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15076, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15077, 0, 0, 32, 1, 98, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15078, 0, 0, 32, 1, 98, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15079, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 32, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15048, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15049, 0, 0, 32, 1, 98, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15050, 0, 0, 32, 1, 98, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15051, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 32, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 56, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 104, 0x20);
}
/** rct2: 0x008A63A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15052, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15053, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15054, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15055, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15024, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15025, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15026, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15027, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A63B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15064, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15065, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15068, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15066, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15069, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15067, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 12, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15036, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15037, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15040, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15038, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15041, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15039, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 12, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 24, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
}
/** rct2: 0x008A63C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15070, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15071, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15074, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15072, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15075, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15073, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 20, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15042, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15043, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15046, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15044, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15047, 0, 0, 32, 1, 66, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15045, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 20, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 24, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
}
/** rct2: 0x008A63D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15056, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15057, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15058, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15059, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15028, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15029, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15030, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15031, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A63E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A63F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6400 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6410 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6420 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6430 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6440 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15183, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15188, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15193, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15178, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15182, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15187, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15192, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15177, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15181, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15186, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15191, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15176, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
<API key>(session, height + 32, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15180, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15185, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15190, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15175, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15179, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15184, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15189, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15174, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6450 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A6460 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6470 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6480 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6490 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A64A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15203, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15214, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15208, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15213, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15198, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15202, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15207, 0, 0, 32, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15212, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15197, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15201, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15206, 0, 0, 16, 16, 1, height, 16, 16,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15211, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15196, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
<API key>(session, height + 32, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15200, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15205, 0, 0, 16, 32, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15210, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15195, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15199, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15204, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15209, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15215, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15194, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A64B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A64C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15096, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15112, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15097, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15113, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15098, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15099, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A64D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15100, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15101, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15102, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15114, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15103, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15115, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A64E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15104, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15116, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15105, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15117, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15106, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15107, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A64F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15108, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15109, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15110, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15118, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15111, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15119, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A6500 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6510 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6520 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6530 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6540 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15088, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15089, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15090, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15091, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6550 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6560 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15296, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15301, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15306, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15311, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15297, 0, 0, 32, 16, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15302, 0, 0, 32, 16, 3, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15307, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15312, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15298, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15303, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15308, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15313, 0, 0, 16, 16, 3, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 64, 0x20);
break;
case 4:
<API key>(session, height + 72, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15299, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15304, 0, 0, 16, 32, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15309, 0, 0, 16, 32, 3, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15314, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15300, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15305, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15310, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15315, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_2);
break;
case 3:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6570 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15276, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15281, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15286, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15291, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15277, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15282, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15287, 0, 0, 32, 16, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15292, 0, 0, 32, 16, 3, height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15278, 0, 0, 16, 16, 3, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15283, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15288, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15293, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 64, 0x20);
break;
case 4:
<API key>(session, height + 72, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15279, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15284, 0, 0, 16, 32, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15289, 0, 0, 16, 32, 3, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15294, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15280, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15285, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15290, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15295, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_2);
break;
case 1:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6580 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height, mapElement);
}
/** rct2: 0x008A6590 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A65A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height);
<API key>(session, <API key>, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height);
<API key>(session, <API key>, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6,
height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height);
<API key>(session, <API key>, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height);
<API key>(session, <API key>, 6, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 1:
<API key>(session, height, TUNNEL_0);
break;
case 2:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A65B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6,
height);
<API key>(session, <API key>, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6,
height);
<API key>(session, <API key>, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6,
height);
<API key>(session, <API key>, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6,
height);
<API key>(session, <API key>, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 1:
<API key>(session, height, TUNNEL_0);
break;
case 2:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A65C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15348, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15356, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15355, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15363, 0, 6, 32, 20, 7, height);
break;
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15349, 0, 0, 32, 26, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15357, 0, 14, 32, 2, 63, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15354, 0, 6, 32, 26, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15362, 0, 6, 32, 26, 3, height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15350, 16, 0, 3, 16, 119, height, 16,
0, height);
<API key>(session, <API key>, 1, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15364, 16, 0, 3, 16, 119, height, 16,
0, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15358, 12, 0, 3, 16, 119, height, 12,
0, height);
<API key>(session, <API key>, 0, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15366, 12, 0, 3, 16, 119, height, 12,
0, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15353, 10, 16, 4, 16, 119, height, 10,
16, height);
<API key>(session, <API key>, 2, 0, height - 8, session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15365, 10, 16, 4, 16, 119, height, 10,
16, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15361, 16, 16, 2, 16, 119, height, 16,
16, height);
<API key>(session, <API key>, 3, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15367, 16, 16, 2, 16, 119, height, 16,
16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 168, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15351, 0, 0, 32, 16, 3, height + 32);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15359, 0, 0, 32, 16, 3, height + 32);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15352, 0, 16, 32, 16, 3, height + 32);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15360, 0, 16, 32, 16, 3, height + 32);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 4:
<API key>(session, height + 48, 0x20);
break;
case 5:
<API key>(session, height + 48, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15352, 0, 16, 32, 16, 3, height + 32);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15360, 0, 16, 32, 16, 3, height + 32);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15351, 0, 0, 32, 16, 3, height + 32);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15359, 0, 0, 32, 16, 3, height + 32);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15353, 10, 16, 4, 16, 119, height, 10,
16, height);
<API key>(session, <API key>, 2, 0, height - 8, session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15365, 10, 16, 4, 16, 119, height, 10,
16, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15361, 16, 16, 2, 16, 119, height, 16,
16, height);
<API key>(session, <API key>, 3, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15367, 16, 16, 2, 16, 119, height, 16,
16, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15350, 16, 0, 3, 16, 119, height, 16,
0, height);
<API key>(session, <API key>, 1, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15364, 16, 0, 3, 16, 119, height, 16,
0, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15358, 12, 0, 3, 16, 119, height, 12,
0, height);
<API key>(session, <API key>, 0, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15366, 12, 0, 3, 16, 119, height, 12,
0, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 168, 0x20);
break;
case 8:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15354, 0, 6, 32, 26, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15362, 0, 6, 32, 26, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15349, 0, 0, 32, 26, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15357, 0, 14, 32, 2, 63, height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 9:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15355, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15363, 0, 6, 32, 20, 7, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15348, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15356, 0, 6, 32, 20, 3, height);
break;
}
switch (direction)
{
case 1:
<API key>(session, height - 8, TUNNEL_1);
break;
case 2:
<API key>(session, height - 8, TUNNEL_1);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A65D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15383, 0, 6, 32, 20, 7, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15375, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15376, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15368, 0, 6, 32, 20, 3, height);
break;
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(session, height + 56, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15382, 0, 6, 32, 26, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15374, 0, 6, 32, 26, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15377, 0, 14, 32, 2, 63, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15369, 0, 0, 32, 26, 3, height);
break;
}
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15381, 16, 16, 2, 16, 119, height, 16,
16, height);
<API key>(session, <API key>, 3, 0, height - 8, session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15384, 16, 16, 2, 16, 119, height, 16,
16, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15373, 10, 16, 4, 16, 119, height, 10,
16, height);
<API key>(session, <API key>, 1, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15386, 10, 16, 4, 16, 119, height, 10,
16, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15378, 12, 0, 3, 16, 119, height, 12,
0, height);
<API key>(session, <API key>, 0, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15385, 12, 0, 3, 16, 119, height, 12,
0, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15370, 16, 0, 2, 16, 119, height, 16,
0, height);
<API key>(session, <API key>, 2, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15387, 16, 0, 2, 16, 119, height, 16,
0, height);
break;
}
<API key>(session, height + 168, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15380, 0, 16, 32, 16, 3, height + 32);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15372, 0, 16, 32, 16, 3, height + 32);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15379, 0, 0, 32, 16, 3, height + 32);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15371, 0, 0, 32, 16, 3, height + 32);
break;
}
<API key>(session, height + 48, 0x20);
break;
case 4:
<API key>(session, height + 48, 0x20);
break;
case 5:
<API key>(session, height + 48, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15379, 0, 0, 32, 16, 3, height + 32);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15371, 0, 0, 32, 16, 3, height + 32);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15380, 0, 16, 32, 16, 3, height + 32);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15372, 0, 16, 32, 16, 3, height + 32);
break;
}
<API key>(session, height + 48, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15378, 12, 0, 3, 16, 119, height, 12,
0, height);
<API key>(session, <API key>, 0, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15385, 12, 0, 3, 16, 119, height, 12,
0, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15370, 16, 0, 2, 16, 119, height, 16,
0, height);
<API key>(session, <API key>, 2, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15387, 16, 0, 2, 16, 119, height, 16,
0, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15381, 16, 16, 2, 16, 119, height, 16,
16, height);
<API key>(session, <API key>, 3, 0, height - 8, session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15384, 16, 16, 2, 16, 119, height, 16,
16, height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15373, 10, 16, 4, 16, 119, height, 10,
16, height);
<API key>(session, <API key>, 1, 0, height - 8,
session->TrackColours[SCHEME_TRACK]);
sub_98199C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15386, 10, 16, 4, 16, 119, height, 10,
16, height);
break;
}
<API key>(session, height + 168, 0x20);
break;
case 8:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15377, 0, 14, 32, 2, 63, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15369, 0, 0, 32, 26, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15382, 0, 6, 32, 26, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15374, 0, 6, 32, 26, 3, height);
break;
}
<API key>(session, height + 72, 0x20);
break;
case 9:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15376, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15368, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15383, 0, 6, 32, 20, 7, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15375, 0, 6, 32, 20, 3, height);
break;
}
switch (direction)
{
case 1:
<API key>(session, height - 8, TUNNEL_1);
break;
case 2:
<API key>(session, height - 8, TUNNEL_1);
break;
}
<API key>(session, height + 56, 0x20);
break;
}
<API key>(session, direction, trackSequence);
}
/** rct2: 0x008A6630 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15125, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15128, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15131, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15122, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15124, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15127, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15130, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15121, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15123, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15126, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15129, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15120, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6640 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A6650 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15137, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15144, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15140, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15143, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15134, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15136, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15139, 0, 0, 16, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15142, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15133, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15135, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15138, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15141, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15145, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15132, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6660 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A6670 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15327, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15329, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15331, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15325, 0, 6, 32, 20, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 56, 0x20);
break;
case 2:
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15326, 6, 0, 20, 32, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15328, 6, 0, 20, 32, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15330, 6, 0, 20, 32, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15324, 6, 0, 20, 32, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_2);
break;
case 3:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6680 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15316, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15318, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15320, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15322, 0, 6, 32, 20, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 56, 0x20);
break;
case 2:
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15317, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15319, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15321, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 10, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15323, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_2);
break;
case 1:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6690 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height, mapElement);
}
/** rct2: 0x008A66A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A66B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15165, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15172, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15168, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15171, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15162, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 2, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15163, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15166, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15169, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15173, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15160, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_0);
break;
case 3:
<API key>(session, height + 8, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15162, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15165, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15172, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15168, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15171, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 2, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height, TUNNEL_0);
break;
case 1:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 5:
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15160, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15163, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15166, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15169, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15173, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height + 8, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A66C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15146, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15149, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15152, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15155, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15159, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
<API key>(session, <API key>, 4, 2, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15148, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15151, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15158, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15154, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15157, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_0);
break;
case 1:
<API key>(session, height + 8, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15149, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15152, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15155, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15159, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15146, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 2, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 5:
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15151, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15158, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15154, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15157, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15148, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height + 8, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A66D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (trackSequence >= 4)
{
trackSequence -= 4;
direction = (direction - 1) & 3;
}
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height,
mapElement);
}
/** rct2: 0x008A66E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (trackSequence >= 4)
{
trackSequence -= 4;
direction = (direction + 1) & 3;
}
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height,
mapElement);
}
/** rct2: 0x008A66F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15247, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15258, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15252, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15257, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15242, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15246, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15251, 0, 0, 32, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15256, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15241, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
<API key>(session, height + 32, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15244, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15249, 0, 0, 16, 32, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15254, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15239, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15243, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15248, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15253, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15259, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15238, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 7, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_0);
break;
case 3:
<API key>(session, height + 8, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15242, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15247, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15258, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15252, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15257, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height, TUNNEL_0);
break;
case 1:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 8:
<API key>(session, height + 32, 0x20);
break;
case 9:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15241, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15246, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15251, 0, 0, 16, 32, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15256, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 10:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 11:
<API key>(session, height + 32, 0x20);
break;
case 12:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15239, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15244, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15249, 0, 0, 32, 16, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15254, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 13:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15238, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15243, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15248, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15253, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15259, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
<API key>(session, <API key>, 4, 7, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height + 8, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6700 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15216, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15221, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15226, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15231, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15237, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
<API key>(session, <API key>, 4, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15217, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15222, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15227, 0, 0, 32, 16, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15232, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
<API key>(session, height + 32, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15219, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15224, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15229, 0, 0, 16, 32, 1, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15234, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15220, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15225, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15236, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15230, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15235, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 7, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_0);
break;
case 1:
<API key>(session, height + 8, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 7:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15221, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15226, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15231, 0, 0, 20, 32, 3, height, 6, 0,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15237, 0, 0, 1, 32, 26, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15216, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 1, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height, TUNNEL_0);
break;
case 3:
<API key>(session, height, TUNNEL_0);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 8:
<API key>(session, height + 32, 0x20);
break;
case 9:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15222, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15227, 0, 0, 16, 32, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15232, 0, 0, 16, 32, 3, height, 0, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15217, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 10:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 11:
<API key>(session, height + 32, 0x20);
break;
case 12:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15224, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15229, 0, 0, 32, 16, 1, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15234, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15219, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 13:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15225, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15236, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15230, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15235, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15220, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 7, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height + 8, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6710 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (trackSequence >= 7)
{
trackSequence -= 7;
direction = (direction - 1) & 3;
}
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6720 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
if (trackSequence >= 7)
{
trackSequence -= 7;
direction = (direction + 1) & 3;
}
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6750 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15341, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15345, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15342, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15346, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15343, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15347, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15340, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15344, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
}
<API key>(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2);
<API key>(session, SEGMENTS_ALL, 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
}
/** rct2: 0x008A6730 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15332, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15336, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15333, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15337, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15334, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15338, 0, 0, 2, 28, 59, height, 28, 2,
height + 2);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15335, 0, 0, 28, 28, 3, height, 2, 2,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15339, 0, 0, 28, 28, 1, height, 2, 2,
height + 99);
break;
}
<API key>(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2);
<API key>(session, SEGMENTS_ALL, 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
}
/** rct2: 0x008A6740 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height, mapElement);
}
/** rct2: 0x008A6760 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height, mapElement);
}
/** rct2: 0x008A6770 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15012, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15014, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15013, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15015, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6A40 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15594, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15595, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15596, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15597, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6A50 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15598, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15599, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15600, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15601, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6780 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_MISC] | SPR_STATION_BASE_D, 0, 0, 32, 32, 1,
height);
<API key>(session, <API key>, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
<API key>(session, <API key>, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 0, height, 0, 6,
height + 3);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_MISC] | SPR_STATION_BASE_D, 0, 0, 32, 32, 1,
height);
<API key>(session, <API key>, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
<API key>(session, <API key>, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 0, height, 0, 6,
height + 3);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_MISC] | SPR_STATION_BASE_D, 0, 0, 32, 32, 1,
height);
<API key>(session, <API key>, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
<API key>(session, <API key>, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 0, height, 0, 6,
height + 3);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_MISC] | SPR_STATION_BASE_D, 0, 0, 32, 32, 1,
height);
<API key>(session, <API key>, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
<API key>(session, <API key>, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 0, height, 0, 6,
height + 3);
break;
}
<API key>(session, direction, height + 3, mapElement);
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, SEGMENTS_ALL, 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A6A60 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6A70 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6860 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15526, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15530, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15534, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15538, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15527, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15531, 0, 0, 34, 16, 3, height, 0, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15535, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15539, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15528, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15532, 0, 0, 16, 16, 3, height, 16, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15536, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15540, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15529, 0, 0, 16, 16, 3, height, 16, 16,
height);
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15533, 0, 0, 16, 18, 3, height, 0, 16,
height);
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15537, 0, 0, 16, 16, 3, height, 0, 0,
height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15541, 0, 0, 16, 16, 3, height, 16, 0,
height);
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6870 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15510, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15514, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15518, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15522, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15511, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15515, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15519, 0, 0, 34, 16, 3, height, 0, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15523, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15512, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15516, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15520, 0, 0, 28, 28, 3, height, 4, 4,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15524, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15513, 0, 0, 16, 16, 3, height, 16, 0,
height);
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15517, 0, 0, 16, 16, 3, height, 0, 0,
height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15521, 0, 0, 16, 18, 3, height, 0, 16,
height);
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15525, 0, 0, 16, 16, 3, height, 16, 16,
height);
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6880 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6890 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 3) & 3, height, mapElement);
}
/** rct2: 0x008A68A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15558, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15562, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15566, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15570, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15559, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15563, 0, 0, 34, 16, 0, height, 0, 0,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15567, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15571, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15560, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15564, 0, 0, 16, 16, 0, height, 16, 16,
height + 27);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15568, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15572, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15561, 0, 0, 16, 16, 3, height, 16, 16,
height);
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15565, 0, 0, 16, 18, 0, height, 0, 16,
height + 27);
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15569, 0, 0, 16, 16, 3, height, 0, 0,
height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15573, 0, 0, 16, 16, 3, height, 16, 0,
height);
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A68B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15542, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15546, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15550, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15554, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
<API key>(
session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15543, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15547, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15551, 0, 0, 34, 16, 0, height, 0, 0,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15555, 0, 0, 32, 16, 3, height, 0, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15544, 0, 0, 16, 16, 3, height, 0, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15548, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15552, 0, 0, 28, 28, 0, height, 4, 4,
height + 27);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15556, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 4:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15545, 0, 0, 16, 16, 3, height, 16, 0,
height);
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15549, 0, 0, 16, 16, 3, height, 0, 0,
height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15553, 0, 0, 16, 18, 0, height, 0, 16,
height + 27);
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15557, 0, 0, 16, 16, 3, height, 16, 16,
height);
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A68C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A68D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 3) & 3, height, mapElement);
}
/** rct2: 0x008A6790 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15451, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15423, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15448, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15420, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15450, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15422, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15449, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15421, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A67C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A67F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 36, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
}
}
/** rct2: 0x008A67A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A67D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 16, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A67E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height,
0, 0, height);
<API key>(session, <API key>, 0, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height,
0, 0, height);
<API key>(session, <API key>, 0, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 21, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A67B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A6820 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A6850 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 28, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 104, 0x20);
break;
}
}
/** rct2: 0x008A6800 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
break;
}
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6830 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height,
0, 0, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height,
0, 0, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 17, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6840 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 8, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6810 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
if (<API key>(mapElement))
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
if (<API key>(mapElement))
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
else
{
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
if (<API key>(mapElement))
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
else
{
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height,
session->TrackColours[SCHEME_SUPPORTS]);
break;
}
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A6900 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6910 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6920 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6930 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6960 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A6970 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A6940 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A6950 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 56, 0x20);
break;
}
}
/** rct2: 0x008A6980 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
break;
}
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6990 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 4, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
break;
}
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A69A0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A69B0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height,
-16, -16, height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height,
-16, -16, height + 35);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 48, 0x20);
break;
}
}
/** rct2: 0x008A68E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A68F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 1:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height,
-16, -16, height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 2:
switch (direction)
{
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height,
-16, -16, height + 27);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
case 3:
switch (direction)
{
case 0:
<API key>(session, <API key>, 1, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height,
-16, -16, height);
<API key>(session, <API key>, 0, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
<API key>(session, <API key>, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
<API key>(session, <API key>, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 32, 0x20);
break;
}
}
/** rct2: 0x008A6C00 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15012, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15014, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
case 1:
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15013, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15015, 0, 0, 32, 1, 26, height, 0, 27,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
/** rct2: 0x008A6BC0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15689, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15691, 0, 6, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15693, 0, 6, 32, 20, 3, height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15687, 0, 6, 32, 20, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 56, 0x20);
break;
case 2:
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15688, 6, 0, 20, 32, 3, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15690, 6, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15692, 6, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15686, 6, 0, 20, 32, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_2);
break;
case 3:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6BD0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15678, 0, 6, 32, 20, 3, height);
break;
case 1:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15680, 0, 6, 32, 20, 3, height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15682, 0, 6, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15684, 0, 6, 32, 20, 3, height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 56, 0x20);
break;
case 2:
<API key>(session, height + 56, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15679, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15681, 6, 0, 1, 32, 34, height, 27, 0,
height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15683, 6, 0, 1, 32, 34, height, 27, 0,
height);
<API key>(session, <API key>, 4, 10, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15685, 6, 0, 20, 32, 3, height);
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
break;
}
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_2);
break;
case 1:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6BE0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6BF0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6B80 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15658, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15663, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15668, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15673, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15659, 0, 0, 32, 16, 3, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15664, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15669, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15674, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15660, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15665, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15670, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15675, 0, 0, 16, 16, 3, height);
break;
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 64, 0x20);
break;
case 4:
<API key>(session, height + 72, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15661, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15666, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15671, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15676, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15662, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15667, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15672, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15677, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 2:
<API key>(session, height + 8, TUNNEL_2);
break;
case 3:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6B90 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (trackSequence)
{
case 0:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15638, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15643, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15648, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15653, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
<API key>(
session, <API key>(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 1:
<API key>(session, height + 72, 0x20);
break;
case 2:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15639, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15644, 0, 0, 32, 16, 3, height, 0, 16,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15649, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 3:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15654, 0, 0, 32, 16, 3, height);
break;
}
<API key>(
session,
<API key>(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 3:
switch (direction)
{
case 0:
sub_98196C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15640, 0, 0, 16, 16, 3, height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15645, 0, 0, 16, 16, 3, height, 16, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15650, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15655, 0, 0, 16, 16, 3, height, 0, 16,
height);
break;
}
<API key>(
session, <API key>(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
<API key>(session, height + 64, 0x20);
break;
case 4:
<API key>(session, height + 72, 0x20);
break;
case 5:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15641, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15646, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15651, 0, 0, 1, 1, 34, height, 30, 30,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15656, 0, 0, 16, 32, 3, height, 16, 0,
height);
break;
}
<API key>(
session,
<API key>(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
case 6:
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15642, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15647, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15652, 0, 0, 1, 32, 34, height, 27, 0,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15657, 0, 0, 20, 32, 3, height, 6, 0,
height);
break;
}
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
switch (direction)
{
case 0:
<API key>(session, height + 8, TUNNEL_2);
break;
case 1:
<API key>(session, height + 8, TUNNEL_2);
break;
}
<API key>(
session, <API key>(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0);
<API key>(session, height + 72, 0x20);
break;
}
}
/** rct2: 0x008A6BA0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction + 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6BB0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
trackSequence = <API key>[trackSequence];
<API key>(session, rideIndex, trackSequence, (direction - 1) & 3, height,
mapElement);
}
/** rct2: 0x008A6A80 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15602, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15603, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15610, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15604, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15605, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6A90 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15606, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15607, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15608, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15611, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15609, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6AA0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15612, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15613, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15620, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15614, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15615, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6AB0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15616, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15617, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15618, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15621, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15619, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 8, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_1);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 56, 0x20);
}
/** rct2: 0x008A6AC0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6AD0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6AE0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6AF0 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6B00 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15622, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15623, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15624, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15625, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A6B10 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15626, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15627, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15628, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15629, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A6B40 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15630, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15631, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15632, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15633, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A6B50 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15634, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15635, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15636, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15637, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A6B60 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6B70 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6B20 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A6B30 */
static void <API key>(paint_session * session, uint8 rideIndex,
uint8 trackSequence, uint8 direction, sint32 height,
rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height,
mapElement);
}
/** rct2: 0x008A69C0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15574, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15575, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15582, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15576, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15577, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A69D0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15578, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15579, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15580, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15583, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15581, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height, TUNNEL_0);
}
else
{
<API key>(session, direction, height, TUNNEL_2);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 48, 0x20);
}
/** rct2: 0x008A69E0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15584, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15585, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15592, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15586, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15587, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A69F0 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
switch (direction)
{
case 0:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15588, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 1:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15589, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15590, 0, 0, 32, 20, 3, height, 0, 6,
height);
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15593, 0, 0, 32, 1, 34, height, 0, 27,
height);
break;
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | 15591, 0, 0, 32, 20, 3, height, 0, 6,
height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 6, height, session->TrackColours[SCHEME_SUPPORTS]);
}
if (direction == 0 || direction == 3)
{
<API key>(session, direction, height - 8, TUNNEL_0);
}
else
{
<API key>(session, direction, height + 8, TUNNEL_12);
}
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 40, 0x20);
}
/** rct2: 0x008A6A00 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6A10 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6A20 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
/** rct2: 0x008A6A30 */
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence,
uint8 direction, sint32 height, rct_map_element * mapElement)
{
<API key>(session, rideIndex, trackSequence, (direction + 2) & 3, height, mapElement);
}
static void <API key>(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction,
sint32 height, rct_map_element * mapElement)
{
if (!is_csg_loaded())
{
<API key>(session, rideIndex, trackSequence, direction, height, mapElement);
return;
}
uint32 sprite_ne_sw = SPR_CSG_BEGIN + 55679;
uint32 sprite_nw_se = SPR_CSG_BEGIN + 55680;
switch (direction)
{
case 0:
case 2:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | sprite_ne_sw, 0, 0, 32, 20, 3, height, 0,
6, height);
break;
case 1:
case 3:
sub_98197C_rotated(session, direction, session->TrackColours[SCHEME_TRACK] | sprite_nw_se, 0, 0, 32, 20, 3, height, 0,
6, height);
break;
}
if (<API key>(session->MapPosition))
{
<API key>(session, <API key>, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS]);
}
<API key>(session, direction, height, TUNNEL_0);
<API key>(session, <API key>(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction),
0xFFFF, 0);
<API key>(session, height + 32, 0x20);
}
<API key> <API key>(sint32 trackType, sint32 direction)
{
switch (trackType)
{
case TRACK_ELEM_FLAT:
return <API key>;
case <API key>:
case <API key>:
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case TRACK_ELEM_BRAKES:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case <API key>:
return <API key>;
case TRACK_ELEM_BOOSTER:
return <API key>;
}
return NULL;
}
|
package com.tikaji.halocraft;
import com.tikaji.halocraft.common.handlers.<API key>;
import com.tikaji.halocraft.common.proxy.IProxy;
import com.tikaji.halocraft.common.utility.Reference;
import com.tikaji.halocraft.common.utility.VersionChecker;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.<API key>;
import net.minecraftforge.fml.common.event.<API key>;
import net.minecraftforge.fml.common.event.<API key>;
@Mod(modid = Reference.ModInfo.MOD_ID, name = Reference.ModInfo.MOD_NAME, version = Reference.ModInfo.VERSION)
public class HaloCraft
{
@Mod.Instance
public static HaloCraft INSTANCE;
public static boolean <API key> = false;
@SidedProxy(clientSide = Reference.ModInfo.CLIENT_PROXY_CLASS, serverSide = Reference.ModInfo.SERVER_PROXY_CLASS)
public static IProxy proxy;
public static VersionChecker versionChecker;
public static String prependModID(String name)
{
return Reference.ModInfo.MOD_ID + ":" + name;
}
@Mod.EventHandler
public void initialize(<API key> event)
{
proxy.init();
}
@Mod.EventHandler
public void postInit(<API key> event)
{
proxy.postInit();
<API key>.postInit();
}
@Mod.EventHandler
public void preInit(<API key> event)
{
<API key>.init(new Configuration(event.<API key>()));
proxy.preInit();
<API key>.save();
}
}
|
<?php
namespace OldTown\Workflow\Spi\Doctrine\EntityRepository\Exception;
use OldTown\Workflow\Spi\Doctrine\Exception\ExceptionInterface as <API key>;
/**
* Interface ExceptionInterface
*
* @package OldTown\Workflow\Spi\Doctrine\EntityRepository\Exception
*/
interface ExceptionInterface extends <API key>
{
}
|
<form ng-submit="add()" name="contact_form">
<div class="row">
<div class="col s14">
<div class="input-field">
<i ng-if="config.json.help" class="material-icons tooltipped contact-tooltip" data-position="right" data-delay="50" data-tooltip="{{config.json.help}}">help</i>
<input name="input" type="text" ng-model="model" class="field" style="line-height: normal"
ng-pattern="config.pattern" id="{{config.json.type}}_input" ng-class="{'invalid': !contact_form['input'].$valid}"/>
<label for="{{config.json.type}}_input" class="active">
<span class="valign-wrapper">
<i ng-if="config.json.icon" class="material-icons left">{{config.json.icon}}</i>
<img ng-if="config.json.img" ng-src="{{config.img}}" class="contact-img"/>
{{config.json.title || config.json.type}}
</span>
</label>
</div>
</div>
<div class="col s10 contact-add">
<a class="btn" ng-if="model.length" ng-click="add()"><i class="material-icons left md-17">add</i>
<span class="<API key>">add</span>
</a>
</div>
</div>
</form>
|
#include <boost/date_time/posix_time/posix_time.hpp>
#include "gnss_functions.hpp"
#include "GnssLogTime.hpp"
#include "common_functions.hpp"
GnssLogTime::GnssLogTime() {
week_ = 0;
milliseconds_ = 0;
}
GnssLogTime::GnssLogTime(unsigned short week, unsigned int milliseconds) {
week_ = week;
milliseconds_ = milliseconds;
utcTime_ = getLogTime(week_, milliseconds_);
}
GnssLogTime::GnssLogTime(const GnssLogTime& gnssLogTime) : stringUtcTime_(gnssLogTime.stringUtcTime_),
stringIsoTime_(gnssLogTime.stringIsoTime_)
{
week_ = gnssLogTime.week_;
milliseconds_ = gnssLogTime.milliseconds_;
utcTime_ = gnssLogTime.utcTime_;
}
GnssLogTime::~GnssLogTime() {
}
GnssLogTime& GnssLogTime::operator=(const GnssLogTime& b) {
week_ = b.week_;
milliseconds_ = b.milliseconds_;
utcTime_ = b.utcTime_;
stringUtcTime_ = b.stringUtcTime_;
stringIsoTime_ = b.stringIsoTime_;
return *this;
}
bool GnssLogTime::operator==(const GnssLogTime& b) const {
return ((week_ == b.week_) && (milliseconds_ == b.milliseconds_));
}
bool GnssLogTime::operator!=(const GnssLogTime& b) const {
return ((week_ != b.week_) || (milliseconds_ != b.milliseconds_));
}
bool GnssLogTime::operator<(const GnssLogTime& b) const {
return ((week_ < b.week_) || (milliseconds_ < b.milliseconds_));
}
bool GnssLogTime::operator>(const GnssLogTime& b) const {
return ((week_ >= b.week_) && (milliseconds_ > b.milliseconds_));
}
bool GnssLogTime::operator<=(const GnssLogTime& b) const {
return ((*this < b) || (*this == b));
}
bool GnssLogTime::operator>=(const GnssLogTime& b) const {
return ((*this > b) || (*this == b));
}
PTime
GnssLogTime::getUtcTime() {
//return UTC time in ptime variable
return utcTime_;
}
std::string
GnssLogTime::getStringUtcTime() {
//return UTC time in string format
if (stringUtcTime_.empty()) {
stringUtcTime_ = pTimeToSimpleString(utcTime_);
}
return stringUtcTime_;
}
std::string GnssLogTime::getStringIsoTime() {
//return UTS time in ISO extended string
if (stringIsoTime_.empty()) {
stringIsoTime_ = pTimeToIsoString(utcTime_);
}
return stringIsoTime_;
}
unsigned short
GnssLogTime::getWeek() {
return week_;
}
unsigned int
GnssLogTime::getMilliseconds() {
return milliseconds_;
}
|
#ifndef Func_seq_H
#define Func_seq_H
#include "Procedure.h"
#include <string>
namespace RevLanguage {
template <typename valType>
class Func_seq : public Procedure {
public:
Func_seq();
// Basic utility functions
Func_seq* clone(void) const; //!< Clone the object
static const std::string& getClassType(void); //!< Get Rev type
static const TypeSpec& getClassTypeSpec(void); //!< Get class type spec
std::string getFunctionName(void) const; //!< Get the primary name of the function in Rev
const TypeSpec& getTypeSpec(void) const; //!< Get language type of the object
// Regular functions
const ArgumentRules& getArgumentRules(void) const; //!< Get argument rules
const TypeSpec& getReturnType(void) const; //!< Get type of return value
RevPtr<RevVariable> execute(void); //!< Execute function
protected:
};
}
#include "ArgumentRule.h"
#include "Ellipsis.h"
#include "RbUtil.h"
#include "TypedDagNode.h"
#include "TypeSpec.h"
template <typename valType>
RevLanguage::Func_seq<valType>::Func_seq() : Procedure() {
}
/* Clone object */
template <typename valType>
RevLanguage::Func_seq<valType>* RevLanguage::Func_seq<valType>::clone( void ) const {
return new Func_seq( *this );
}
/** Execute function: We rely on getValue and overloaded push_back to provide functionality */
template <typename valType>
RevLanguage::RevPtr<RevLanguage::RevVariable> RevLanguage::Func_seq<valType>::execute( void )
{
typename valType::valueType from = static_cast<const valType &>( args[0].getVariable()->getRevObject() ).getValue();
typename valType::valueType to = static_cast<const valType &>( args[1].getVariable()->getRevObject() ).getValue();
typename valType::valueType by = static_cast<const valType &>( args[2].getVariable()->getRevObject() ).getValue();
typename valType::valueType val = from;
// typename valType::valueType eps = valType::EPSILON;
typename valType::valueType eps = std::numeric_limits<typename valType::valueType>::epsilon();
ModelVector<valType> *seq = new ModelVector<valType>();
// while ( (val >= from && val <= to) || (val <= from && val >= to) )
while ( ((val - from) >= -eps && (val - to) <= eps) || ((val - from) <= eps && (val - to) >= -eps) )
{
seq->push_back( valType( val ) );
val += by;
}
return new RevVariable( seq );
}
/** Get argument rules */
template <typename valType>
const RevLanguage::ArgumentRules& RevLanguage::Func_seq<valType>::getArgumentRules( void ) const
{
static ArgumentRules argumentRules = ArgumentRules();
static bool rules_set = false;
if ( !rules_set )
{
argumentRules.push_back( new ArgumentRule( "from", valType::getClassTypeSpec(), "The first value of the sequence.", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
argumentRules.push_back( new ArgumentRule( "to" , valType::getClassTypeSpec(), "The last value of the sequence.", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
argumentRules.push_back( new ArgumentRule( "by" , valType::getClassTypeSpec(), "The step-size between value.", ArgumentRule::BY_VALUE, ArgumentRule::ANY ) );
rules_set = true;
}
return argumentRules;
}
/** Get Rev type of object */
template <typename valType>
const std::string& RevLanguage::Func_seq<valType>::getClassType(void)
{
static std::string rev_type = "Func_seq<" + valType::getClassType() + ">";
return rev_type;
}
/** Get class type spec describing type of object */
template <typename valType>
const RevLanguage::TypeSpec& RevLanguage::Func_seq<valType>::getClassTypeSpec(void)
{
static TypeSpec rev_type_spec = TypeSpec( getClassType(), new TypeSpec( Function::getClassTypeSpec() ) );
return rev_type_spec;
}
/**
* Get the primary Rev name for this function.
*/
template <typename valType>
std::string RevLanguage::Func_seq<valType>::getFunctionName( void ) const
{
// create a name variable that is the same for all instance of this class
std::string f_name = "seq";
return f_name;
}
/** Get type spec */
template <typename valType>
const RevLanguage::TypeSpec& RevLanguage::Func_seq<valType>::getTypeSpec( void ) const
{
static TypeSpec type_spec = getClassTypeSpec();
return type_spec;
}
/** Get return type */
template <typename valType>
const RevLanguage::TypeSpec& RevLanguage::Func_seq<valType>::getReturnType( void ) const {
return ModelVector<valType>::getClassTypeSpec();
}
#endif
|
package com.kraz.minehr.items;
import com.kraz.minehr.MineHr;
import com.kraz.minehr.reference.Reference;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemHoe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class HorizonHoe extends ItemHoe {
public HorizonHoe() {
super(MineHr.HorizonToolMaterial);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(Reference.MOD_ID + ":" + this.getUnlocalizedName().substring(5));
}
}
|
from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empty(1024, dtype=[('Position', ('f8', 3)), ('Mass', 'f8')])
dset['Position'] = numpy.random.random(size=(1024, 3))
dset['Mass'] = numpy.random.random(size=1024)
tmpfile = tempfile.mkstemp()[1]
with h5py.File(tmpfile , 'w') as ff:
ds = ff.create_dataset('X', data=dset) # store structured array as dataset
ds.attrs['BoxSize'] = 1.0
grp = ff.create_group('Y')
grp.create_dataset('Position', data=dset['Position']) # column as dataset
grp.create_dataset('Mass', data=dset['Mass']) # column as dataset
cosmo = cosmology.Planck15
source = HDFCatalog(tmpfile, dataset='X', attrs={"Nmesh":32}, comm=comm)
assert_allclose(source['Position'], dset['Position'])
region = source.query_range(32, 64)
assert_allclose(region['Position'], dset['Position'][32:64])
os.unlink(tmpfile)
@MPITest([1, 4])
def test_query_range(comm):
import h5py
# fake structured array
dset = numpy.empty(1024, dtype=[('Position', ('f8', 3)), ('Mass', 'f8'), ('Index', 'i8')])
dset['Index'] = numpy.arange(1024)
dset['Position'] = numpy.random.random(size=(1024, 3))
dset['Mass'] = numpy.random.random(size=1024)
if comm.rank == 0:
tmpfile = tempfile.mkstemp()[1]
with h5py.File(tmpfile , 'w') as ff:
ds = ff.create_dataset('X', data=dset) # store structured array as dataset
ds.attrs['BoxSize'] = 1.0
tmpfile = comm.bcast(tmpfile)
else:
tmpfile = comm.bcast(None)
cosmo = cosmology.Planck15
source = HDFCatalog(tmpfile, dataset='X', attrs={"Nmesh":32}, comm=comm)
correct_region = source.gslice(32, 64)
region = source.query_range(32, 64)
assert_allclose(
numpy.concatenate(comm.allgather(region['Index'].compute())),
numpy.arange(32, 64)
)
if comm.rank == 0:
os.unlink(tmpfile)
@MPITest([1])
def test_csv(comm):
with tempfile.NamedTemporaryFile() as ff:
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(ff, data, fmt='%.7e'); ff.seek(0)
# read nrows
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog(ff.name, names, blocksize=100, comm=comm)
# make sure data is the same
for i, name in enumerate(names):
numpy.testing.assert_almost_equal(data[:,i], f[name].compute(), decimal=7)
# make sure all the columns are there
assert all(col in f for col in names)
@MPITest([1])
def test_stack_glob(comm):
tmpfile1 = 'test-glob-1.dat'
tmpfile2 = 'test-glob-2.dat'
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(tmpfile1, data, fmt='%.7e')
numpy.savetxt(tmpfile2, data, fmt='%.7e')
# read using a glob
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog('test-glob-*', names, blocksize=100, comm=comm)
# make sure print works
print(f)
# make sure data is the same
fulldata = numpy.concatenate([data, data], axis=0)
for i, name in enumerate(names):
numpy.testing.assert_almost_equal(fulldata[:,i], f[name].compute(), decimal=7)
# make sure all the columns are there
assert all(col in f for col in names)
os.unlink(tmpfile1)
os.unlink(tmpfile2)
@MPITest([1])
def test_stack_list(comm):
tmpfile1 = 'test-list-1.dat'
tmpfile2 = 'test-list-2.dat'
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(tmpfile1, data, fmt='%.7e')
numpy.savetxt(tmpfile2, data, fmt='%.7e')
# read using a glob
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog(['test-list-1.dat', 'test-list-2.dat'], names, blocksize=100, comm=comm)
# make sure print works
print(f)
# make sure data is the same
fulldata = numpy.concatenate([data, data], axis=0)
for i, name in enumerate(names):
numpy.testing.assert_almost_equal(fulldata[:,i], f[name].compute(), decimal=7)
# make sure all the columns are there
assert all(col in f for col in names)
os.unlink(tmpfile1)
os.unlink(tmpfile2)
|
package com.taobao.api.response;
import com.taobao.api.TaobaoResponse;
import com.taobao.api.internal.mapping.ApiField;
/**
* TOP API: taobao.logistics.consign.order.createandsend response.
*
* @author auto create
* @since 1.0, null
*/
public class <API key> extends TaobaoResponse {
private static final long serialVersionUID = <API key>;
@ApiField("is_success")
private Boolean isSuccess;
@ApiField("order_id")
private Long orderId;
@ApiField("result_desc")
private String resultDesc;
public Boolean getIsSuccess() {
return this.isSuccess;
}
public Long getOrderId() {
return this.orderId;
}
public String getResultDesc() {
return this.resultDesc;
}
public void setIsSuccess(Boolean isSuccess) {
this.isSuccess = isSuccess;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public void setResultDesc(String resultDesc) {
this.resultDesc = resultDesc;
}
}
|
package com.voicecrystal.pixeldungeonlegends.actors.hero;
import com.watabou.utils.Bundle;
public enum HeroSubClass {
NONE( null, null ),
GLADIATOR( "gladiator",
"A successful attack with a melee weapon allows the _Gladiator_ to start a combo, " +
"in which every next successful hit inflicts more damage." ),
BERSERKER( "berserker",
"When severely wounded, the _Berserker_ enters a state of wild fury " +
"significantly increasing his damage output." ),
WARLOCK( "warlock",
"After killing an enemy the _Warlock_ consumes its soul. " +
"It heals his wounds and satisfies his hunger." ),
BATTLEMAGE( "battlemage",
"When fighting with a wand in his hands, the _Battlemage_ inflicts additional damage depending " +
"on the current number of charges. Every successful hit restores 1 charge to this wand." ),
ASSASSIN( "assassin",
"When performing a surprise attack, the _Assassin_ inflicts additional damage to his target." ),
FREERUNNER( "freerunner",
"The _Freerunner_ can move almost twice faster, than most of the monsters. When he " +
"is running, the Freerunner is much harder to hit. For that he must be unencumbered and not starving." ),
SNIPER( "sniper",
"_Snipers_ are able to detect weak points in an enemy's armor, " +
"effectively ignoring it when using a missile weapon." ),
WARDEN( "warden",
"Having a strong connection with forces of nature gives _Wardens_ an ability to gather dewdrops and " +
"seeds from plants. Also trampling a high grass grants them a temporary armor buff." );
private String title;
private String desc;
private HeroSubClass( String title, String desc ) {
this.title = title;
this.desc = desc;
}
public String title() {
return title;
}
public String desc() {
return desc;
}
private static final String SUBCLASS = "subClass";
public void storeInBundle( Bundle bundle ) {
bundle.put( SUBCLASS, toString() );
}
public static HeroSubClass restoreInBundle( Bundle bundle ) {
String value = bundle.getString( SUBCLASS );
try {
return valueOf( value );
} catch (Exception e) {
return NONE;
}
}
}
|
<?php
namespace IBCTorreon;
/**
* Clase VillaJardin
*/
class VillaJardin extends \IBCBase\PublicacionWeb {
/**
* Constructor
*/
public function __construct() {
$this->nombre = 'Villa Jardin';
$this->autor = 'IMPLAN Torreón Staff';
$this->fecha = '2016-09-02 12:55:35';
$this->archivo = 'villa-jardin';
$this->imagen = '../imagenes/imagen.jpg';
$this->imagen_previa = '../imagenes/imagen-previa.jpg';
$this->descripcion = 'Colonia Villa Jardin de IBC Torreón.';
$this->claves = 'IMPLAN, Torreon, Desagregación';
$this->directorio = 'ibc-torreon';
$this->nombre_menu = 'IBC > IBC Torreón';
// Para el Organizador
$this->categorias = array();
$this->fuentes = array();
$this->regiones = array();
} // constructor
/**
* Datos
*
* @return array Arreglo asociativo
*/
public function datos() {
return array(
'Demografía' => array(
'Población total' => '548',
'Porcentaje de población masculina' => '46.41',
'Porcentaje de población femenina' => '53.59',
'Porcentaje de población de 0 a 14 años' => '11.60',
'Porcentaje de población de 15 a 64 años' => '63.71',
'Porcentaje de población de 65 y más años' => '13.63',
'Porcentaje de población no especificada' => '11.06',
'Fecundidad promedio' => '1.93',
'Porcentaje de población nacida en otro estado' => '24.29',
'Porcentaje de población con discapacidad' => '4.61'
),
'Educación' => array(
'Grado Promedio de Escolaridad' => '14.01',
'Grado Promedio de Escolaridad masculina' => '14.57',
'Grado Promedio de Escolaridad femenina' => '13.51'
),
'Características Económicas' => array(
'Población Económicamente Activa' => '52.20',
'Población Económicamente Activa masculina' => '63.52',
'Población Económicamente Activa femenina' => '36.48',
'Población Ocupada' => '93.39',
'Población Ocupada masculina' => '63.47',
'Población Ocupada femenina' => '36.53',
'Población Desocupada' => '6.61',
'Derechohabiencia' => '72.90'
),
'Viviendas' => array(
'Hogares' => '154',
'Hogares Jefatura masculina' => '80.29',
'Hogares Jefatura femenina' => '19.71',
'Ocupación por Vivienda' => '3.56',
'Viviendas con Electricidad' => '99.72',
'Viviendas con Agua' => '100.00',
'Viviendas con Drenaje' => '99.72',
'Viviendas con Televisión' => '89.25',
'Viviendas con Automóvil' => '84.62',
'Viviendas con Computadora' => '72.81',
'Viviendas con Celular' => '82.00',
'Viviendas con Internet' => '68.86'
),
'Unidades Económicas' => array(
'Total Actividades Económicas' => '52',
'Primer actividad nombre' => 'Otros servicios, excepto Gobierno',
'Primer actividad porcentaje' => '15.38',
'Segunda actividad nombre' => 'Inmobiliarios',
'Segunda actividad porcentaje' => '13.46',
'Tercera actividad nombre' => 'Comercio Menudeo',
'Tercera actividad porcentaje' => '11.54',
'Cuarta actividad nombre' => 'Salud',
'Cuarta actividad porcentaje' => '7.69',
'Quinta actividad nombre' => 'Profesionales, Científicos, Técnicos',
'Quinta actividad porcentaje' => '7.69'
)
);
} // datos
} // Clase VillaJardin
?>
|
#ifndef <API key>
#define <API key>
/*
* User space memory access functions
*/
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/lockdep.h>
#include <linux/kasan-checks.h>
#include <asm/alternative.h>
#include <asm/cpufeatures.h>
#include <asm/page.h>
/*
* Copy To/From Userspace
*/
/* Handles exceptions in both to and from, but doesn't do access_ok */
__must_check unsigned long
<API key>(void *to, const void *from, unsigned len);
__must_check unsigned long
<API key>(void *to, const void *from, unsigned len);
__must_check unsigned long
<API key>(void *to, const void *from, unsigned len);
static __always_inline __must_check unsigned long
copy_user_generic(void *to, const void *from, unsigned len)
{
unsigned ret;
/*
* If CPU has ERMS feature, use <API key>.
* Otherwise, if CPU has rep_good feature, use <API key>.
* Otherwise, use <API key>.
*/
alternative_call_2(<API key>,
<API key>,
<API key>,
<API key>,
X86_FEATURE_ERMS,
ASM_OUTPUT2("=a" (ret), "=D" (to), "=S" (from),
"=d" (len)),
"1" (to), "2" (from), "3" (len)
: "memory", "rcx", "r8", "r9", "r10", "r11");
return ret;
}
__must_check unsigned long
copy_in_user(void __user *to, const void __user *from, unsigned len);
static __always_inline __must_check
int <API key>(void *dst, const void __user *src, unsigned size)
{
int ret = 0;
check_object_size(dst, size, false);
if (!<API key>(size))
{
return copy_user_generic(dst, (__force void *)src, size);
}
switch (size)
{
case 1:
__uaccess_begin();
__get_user_asm(*(u8 *)dst, (u8 __user *)src,
ret, "b", "b", "=q", 1);
__uaccess_end();
return ret;
case 2:
__uaccess_begin();
__get_user_asm(*(u16 *)dst, (u16 __user *)src,
ret, "w", "w", "=r", 2);
__uaccess_end();
return ret;
case 4:
__uaccess_begin();
__get_user_asm(*(u32 *)dst, (u32 __user *)src,
ret, "l", "k", "=r", 4);
__uaccess_end();
return ret;
case 8:
__uaccess_begin();
__get_user_asm(*(u64 *)dst, (u64 __user *)src,
ret, "q", "", "=r", 8);
__uaccess_end();
return ret;
case 10:
__uaccess_begin();
__get_user_asm(*(u64 *)dst, (u64 __user *)src,
ret, "q", "", "=r", 10);
if (likely(!ret))
__get_user_asm(*(u16 *)(8 + (char *)dst),
(u16 __user *)(8 + (char __user *)src),
ret, "w", "w", "=r", 2);
__uaccess_end();
return ret;
case 16:
__uaccess_begin();
__get_user_asm(*(u64 *)dst, (u64 __user *)src,
ret, "q", "", "=r", 16);
if (likely(!ret))
__get_user_asm(*(u64 *)(8 + (char *)dst),
(u64 __user *)(8 + (char __user *)src),
ret, "q", "", "=r", 8);
__uaccess_end();
return ret;
default:
return copy_user_generic(dst, (__force void *)src, size);
}
}
static __always_inline __must_check
int __copy_from_user(void *dst, const void __user *src, unsigned size)
{
might_fault();
kasan_check_write(dst, size);
return <API key>(dst, src, size);
}
static __always_inline __must_check
int <API key>(void __user *dst, const void *src, unsigned size)
{
int ret = 0;
check_object_size(src, size, true);
if (!<API key>(size))
{
return copy_user_generic((__force void *)dst, src, size);
}
switch (size)
{
case 1:
__uaccess_begin();
__put_user_asm(*(u8 *)src, (u8 __user *)dst,
ret, "b", "b", "iq", 1);
__uaccess_end();
return ret;
case 2:
__uaccess_begin();
__put_user_asm(*(u16 *)src, (u16 __user *)dst,
ret, "w", "w", "ir", 2);
__uaccess_end();
return ret;
case 4:
__uaccess_begin();
__put_user_asm(*(u32 *)src, (u32 __user *)dst,
ret, "l", "k", "ir", 4);
__uaccess_end();
return ret;
case 8:
__uaccess_begin();
__put_user_asm(*(u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 8);
__uaccess_end();
return ret;
case 10:
__uaccess_begin();
__put_user_asm(*(u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 10);
if (likely(!ret))
{
asm("":::"memory");
__put_user_asm(4[(u16 *)src], 4 + (u16 __user *)dst,
ret, "w", "w", "ir", 2);
}
__uaccess_end();
return ret;
case 16:
__uaccess_begin();
__put_user_asm(*(u64 *)src, (u64 __user *)dst,
ret, "q", "", "er", 16);
if (likely(!ret))
{
asm("":::"memory");
__put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
ret, "q", "", "er", 8);
}
__uaccess_end();
return ret;
default:
return copy_user_generic((__force void *)dst, src, size);
}
}
static __always_inline __must_check
int __copy_to_user(void __user *dst, const void *src, unsigned size)
{
might_fault();
kasan_check_read(src, size);
return <API key>(dst, src, size);
}
static __always_inline __must_check
int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
{
int ret = 0;
might_fault();
if (!<API key>(size))
return copy_user_generic((__force void *)dst,
(__force void *)src, size);
switch (size)
{
case 1:
{
u8 tmp;
__uaccess_begin();
__get_user_asm(tmp, (u8 __user *)src,
ret, "b", "b", "=q", 1);
if (likely(!ret))
__put_user_asm(tmp, (u8 __user *)dst,
ret, "b", "b", "iq", 1);
__uaccess_end();
return ret;
}
case 2:
{
u16 tmp;
__uaccess_begin();
__get_user_asm(tmp, (u16 __user *)src,
ret, "w", "w", "=r", 2);
if (likely(!ret))
__put_user_asm(tmp, (u16 __user *)dst,
ret, "w", "w", "ir", 2);
__uaccess_end();
return ret;
}
case 4:
{
u32 tmp;
__uaccess_begin();
__get_user_asm(tmp, (u32 __user *)src,
ret, "l", "k", "=r", 4);
if (likely(!ret))
__put_user_asm(tmp, (u32 __user *)dst,
ret, "l", "k", "ir", 4);
__uaccess_end();
return ret;
}
case 8:
{
u64 tmp;
__uaccess_begin();
__get_user_asm(tmp, (u64 __user *)src,
ret, "q", "", "=r", 8);
if (likely(!ret))
__put_user_asm(tmp, (u64 __user *)dst,
ret, "q", "", "er", 8);
__uaccess_end();
return ret;
}
default:
return copy_user_generic((__force void *)dst,
(__force void *)src, size);
}
}
static __must_check __always_inline int
<API key>(void *dst, const void __user *src, unsigned size)
{
kasan_check_write(dst, size);
return <API key>(dst, src, size);
}
static __must_check __always_inline int
<API key>(void __user *dst, const void *src, unsigned size)
{
kasan_check_read(src, size);
return <API key>(dst, src, size);
}
extern long __copy_user_nocache(void *dst, const void __user *src,
unsigned size, int zerorest);
static inline int
<API key>(void *dst, const void __user *src, unsigned size)
{
might_fault();
kasan_check_write(dst, size);
return __copy_user_nocache(dst, src, size, 1);
}
static inline int
<API key>(void *dst, const void __user *src,
unsigned size)
{
kasan_check_write(dst, size);
return __copy_user_nocache(dst, src, size, 0);
}
unsigned long
<API key>(char *to, char *from, unsigned len);
#endif /* <API key> */
|
package listener;
public class IndexManager implements EntryListener {
/**
*
*
* @param entryevent
*/
@Override
public void entryAdded(EntryEvent entryevent) {
System.out.println("IndexManager ");
}
/**
*
*
* @param entryevent
*/
@Override
public void entryDeleted(EntryEvent entryevent) {
System.out.println("IndexManager ");
}
/**
*
*
* @param entryevent
*/
@Override
public void entryModified(EntryEvent entryevent) {
System.out.println("IndexManager ");
}
}
|
<?php
defined('JPATH_PLATFORM') or die;
use Joomla\Registry\Registry;
/**
* Google+ data class for the Joomla Platform.
*
* @since 12.3
*/
class JGoogleDataPlus extends JGoogleData
{
/**
* @var <API key> Google+ API object for people.
* @since 12.3
*/
protected $people;
/**
* @var <API key> Google+ API object for people.
* @since 12.3
*/
protected $activities;
/**
* @var <API key> Google+ API object for people.
* @since 12.3
*/
protected $comments;
/**
* Constructor.
*
* @param Registry $options Google options object
* @param JGoogleAuth $auth Google data http client object
*
* @since 12.3
*/
public function __construct(Registry $options = null, JGoogleAuth $auth = null)
{
// Setup the default API url if not already set.
$options->def('api.url', 'https:
parent::__construct($options, $auth);
if (isset($this->auth) && !$this->auth->getOption('scope'))
{
$this->auth->setOption('scope', 'https:
}
}
/**
* Magic method to lazily create API objects
*
* @param string $name Name of property to retrieve
*
* @return JGoogleDataPlus Google+ API object (people, activities, comments).
*
* @since 12.3
*/
public function __get($name)
{
switch ($name)
{
case 'people':
if ($this->people == null)
{
$this->people = new <API key>($this->options, $this->auth);
}
return $this->people;
case 'activities':
if ($this->activities == null)
{
$this->activities = new <API key>($this->options, $this->auth);
}
return $this->activities;
case 'comments':
if ($this->comments == null)
{
$this->comments = new <API key>($this->options, $this->auth);
}
return $this->comments;
}
}
}
|
<?php
namespace Smartling\Jobs;
use Smartling\ApiWrapperInterface;
use Smartling\Base\ExportedAPI;
use Smartling\Helpers\ArrayHelper;
use Smartling\Queue\QueueInterface;
use Smartling\Settings\SettingsManager;
use Smartling\Submissions\SubmissionManager;
class <API key> extends JobAbstract
{
public const JOB_HOOK_NAME = '<API key>';
private QueueInterface $queue;
public function __construct(
ApiWrapperInterface $api,
SettingsManager $settingsManager,
SubmissionManager $submissionManager,
string $jobRunInterval,
int $workerTTL,
QueueInterface $queue
) {
parent::__construct($api, $settingsManager, $submissionManager, $jobRunInterval, $workerTTL);
$this->queue = $queue;
}
public function getJobHookName(): string
{
return self::JOB_HOOK_NAME;
}
public function run(): void
{
$this->getLogger()->info('Started Translation Download Job.');
$this-><API key>();
$this->getLogger()->info('Finished Translation Download Job.');
}
private function <API key>(): void
{
while (false !== ($submissionId = $this->queue->dequeue(QueueInterface::<API key>))) {
$submissionId = ArrayHelper::first($submissionId);
$result = $this->submissionManager->find(['id' => $submissionId]);
if (0 < count($result)) {
$entity = ArrayHelper::first($result);
} else {
$this->getLogger()
->warning(vsprintf('Got submission id=%s that does not exists in database. Skipping.', [$submissionId]));
continue;
}
do_action(ExportedAPI::<API key>, $entity);
$this->placeLockFlag(true);
}
}
}
|
# revision identifiers, used by Alembic.
revision = '1212f113f03b'
down_revision = '1f07ae132ac8'
from alembic import op
import sqlalchemy as sa
UNITIES = dict(NONE="",
HOUR=u"heure(s)",
DAY=u"jour(s)",
WEEK=u"semaine(s)",
MONTH=u"mois",
FEUIL=u"feuillet(s)",
PACK=u"forfait")
UNITS = (u"heure(s)",
u"jour(s)", u"semaine(s)", u"mois", u"forfait", u"feuillet(s)",)
def translate_unity(unity):
return UNITIES.get(unity, UNITIES["NONE"])
def translate_inverse(unity):
for key, value in UNITIES.items():
if unity == value:
return key
else:
return u"NONE"
def upgrade():
from autonomie.models.task import WorkUnit
from autonomie.models.task.estimation import EstimationLine
from autonomie.models.task.invoice import InvoiceLine
from autonomie.models.task.invoice import CancelInvoiceLine
from autonomie_base.models.base import DBSESSION
# Adding some characters to the Lines
for table in "estimation_line", "invoice_line", "cancelinvoice_line":
op.alter_column(table, "unity", type_=sa.String(100))
for value in UNITS:
unit = WorkUnit(label=value)
DBSESSION().add(unit)
for factory in (EstimationLine, InvoiceLine, CancelInvoiceLine):
for line in factory.query():
line.unity = translate_unity(line.unity)
DBSESSION().merge(line)
def downgrade():
from autonomie.models.task import WorkUnit
from autonomie.models.task.estimation import EstimationLine
from autonomie.models.task.invoice import InvoiceLine
from autonomie.models.task.invoice import CancelInvoiceLine
from autonomie_base.models.base import DBSESSION
for factory in (EstimationLine, InvoiceLine, CancelInvoiceLine):
for line in factory.query():
line.unity = translate_inverse(line.unity)
DBSESSION().merge(line)
for value in WorkUnit.query():
DBSESSION().delete(value)
|
package com.actelion.research.orbit.imageAnalysis.components.icons;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.lang.ref.WeakReference;
import java.util.Base64;
import java.util.Stack;
import javax.imageio.ImageIO;
import javax.swing.SwingUtilities;
import javax.swing.plaf.UIResource;
import org.pushingpixels.neon.api.icon.ResizableIcon;
import org.pushingpixels.neon.api.icon.<API key>;
public class toggle_markup implements ResizableIcon {
private Shape shape = null;
private GeneralPath generalPath = null;
private Paint paint = null;
private Stroke stroke = null;
private Shape clip = null;
private Stack<AffineTransform> transformsStack = new Stack<>();
private void _paint0(Graphics2D g,float origAlpha) {
transformsStack.push(g.getTransform());
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0666667222976685f, 0.0f, 0.0f, 1.0666667222976685f, -0.0f, -0.0f));
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -343.7007751464844f));
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_0
paint = new Color(255, 0, 255, 255);
stroke = new BasicStroke(25.0f,0,0,4.0f,null,0.0f);
shape = new Rectangle2D.Double(86.42857360839844, 424.5050964355469, 187.14285278320312, 205.0);
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(transformsStack.pop());
g.setComposite(AlphaComposite.getInstance(3, 1.0f * origAlpha));
transformsStack.push(g.getTransform());
g.transform(new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f));
// _0_0_1
paint = new Color(0, 255, 255, 255);
stroke = new BasicStroke(25.0f,0,0,4.0f,null,0.0f);
if (generalPath == null) {
generalPath = new GeneralPath();
} else {
generalPath.reset();
}
generalPath.moveTo(450.7143f, 462.36224f);
generalPath.lineTo(425.0f, 703.7908f);
generalPath.lineTo(236.42857f, 766.6479f);
generalPath.lineTo(96.42857f, 826.6479f);
generalPath.lineTo(84.28571f, 947.3622f);
generalPath.lineTo(412.85715f, 1023.0765f);
generalPath.lineTo(482.85715f, 902.3622f);
generalPath.lineTo(620.0f, 989.5051f);
generalPath.lineTo(637.8571f, 420.93365f);
generalPath.closePath();
shape = generalPath;
g.setPaint(paint);
g.setStroke(stroke);
g.draw(shape);
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
g.setTransform(transformsStack.pop());
}
@SuppressWarnings("unused")
private void innerPaint(Graphics2D g) {
float origAlpha = 1.0f;
Composite origComposite = g.getComposite();
if (origComposite instanceof AlphaComposite) {
AlphaComposite origAlphaComposite =
(AlphaComposite)origComposite;
if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) {
origAlpha = origAlphaComposite.getAlpha();
}
}
_paint0(g, origAlpha);
shape = null;
generalPath = null;
paint = null;
stroke = null;
clip = null;
transformsStack.clear();
}
/**
* Returns the X of the bounding box of the original SVG image.
*
* @return The X of the bounding box of the original SVG image.
*/
public static double getOrigX() {
return 75.46253967285156;
}
/**
* Returns the Y of the bounding box of the original SVG image.
*
* @return The Y of the bounding box of the original SVG image.
*/
public static double getOrigY() {
return 65.65621185302734;
}
/**
* Returns the width of the bounding box of the original SVG image.
*
* @return The width of the bounding box of the original SVG image.
*/
public static double getOrigWidth() {
return 618.7836303710938;
}
/**
* Returns the height of the bounding box of the original SVG image.
*
* @return The height of the bounding box of the original SVG image.
*/
public static double getOrigHeight() {
return 674.2141723632812;
}
/** The current width of this resizable icon. */
private int width;
/** The current height of this resizable icon. */
private int height;
/**
* Creates a new transcoded SVG image. This is marked as private to indicate that app
* code should be using the {@link #of(int, int)} method to obtain a pre-configured instance.
*/
private toggle_markup() {
this.width = (int) getOrigWidth();
this.height = (int) getOrigHeight();
}
@Override
public int getIconHeight() {
return height;
}
@Override
public int getIconWidth() {
return width;
}
@Override
public synchronized void setDimension(Dimension newDimension) {
this.width = newDimension.width;
this.height = newDimension.height;
}
@Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g.create();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.<API key>);
g2d.translate(x, y);
double coef1 = (double) this.width / getOrigWidth();
double coef2 = (double) this.height / getOrigHeight();
double coef = Math.min(coef1, coef2);
g2d.clipRect(0, 0, this.width, this.height);
g2d.scale(coef, coef);
g2d.translate(-getOrigX(), -getOrigY());
if (coef1 != coef2) {
if (coef1 < coef2) {
int extraDy = (int) ((getOrigWidth() - getOrigHeight()) / 2.0);
g2d.translate(0, extraDy);
} else {
int extraDx = (int) ((getOrigHeight() - getOrigWidth()) / 2.0);
g2d.translate(extraDx, 0);
}
}
Graphics2D g2ForInner = (Graphics2D) g2d.create();
innerPaint(g2ForInner);
g2ForInner.dispose();
g2d.dispose();
}
/**
* Returns a new instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new instance of this icon with specified dimensions.
*/
public static ResizableIcon of(int width, int height) {
toggle_markup base = new toggle_markup();
base.width = width;
base.height = height;
return base;
}
/**
* Returns a new {@link UIResource} instance of this icon with specified dimensions.
*
* @param width Required width of the icon
* @param height Required height of the icon
* @return A new {@link UIResource} instance of this icon with specified dimensions.
*/
public static <API key> uiResourceOf(int width, int height) {
toggle_markup base = new toggle_markup();
base.width = width;
base.height = height;
return new <API key>(base);
}
/**
* Returns a factory that returns instances of this icon on demand.
*
* @return Factory that returns instances of this icon on demand.
*/
public static Factory factory() {
return toggle_markup::new;
}
}
|
# roadie
[ for more information.
## Description
Roadie helps you to upload your source codes to the cloud, create and delete
instances, and manage outputs.
For example,
sh
$ roadie run --local . --name analyze-wowah script.yml
uploads your source codes in current directory, and run them in such a manner
that `script.yml` specifies. The `script.yml` is a simple YAML file like
yaml
apt:
- unrar
data:
- http://mmnet.iis.sinica.edu.tw/dl/wowah/wowah.rar
run:
- unrar x -r wowah.rar
- analyze WoWAH
The above `script.yml` asks roadie to install apt package `unrar` and
download a data file from such URL as the preparation. Then, it directs
to run those two commands: unrar the downloaded file, analyze the obtained
data files.
Roadie uploads results of such commands to a cloud storage after they finish.
You can access those results by
sh
$ roadie result get analyze-wowah "*" -o ./res
Then, Roadie downloads all result files into `./res` directory.
## Installation
Compiled binary files for some platforms are uploaded in
[release page](https://github.com/jkawamoto/roadie/releases).
If you're a [Homebrew](http:
user, you can install Roadie by the following commands:
sh
$ brew tap jkawamoto/roadie
$ brew install roadie
## Initialization
After installing Roadie, the following initialization is required in order to
authorize Roadie to access cloud services.
sh
$ roadie init
This software except files in `docker` folder is released under The GNU General Public License Version 3, see [COPYING](COPYING) for more detail.
|
#include "camera_control.h"
void error_func (GPContext *context, const char *format, va_list args, void *data) {
context = context;
data = data;
fprintf(stderr, "*** Contexterror ***\n");
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
}
void message_func (GPContext *context, const char *format, va_list args, void *data) {
context = context;
data = data;
vprintf(format, args);
printf("\n");
}
void signal_handler(int sig)
{
printf("Signal ==> %i\n", sig);
}
void signal_inib()
{
struct sigaction act;
int i;
act.sa_handler = signal_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
i = 1;
while (i < 32)
{
if (i != 11)
sigaction(i, &act, NULL);
i++;
}
}
int init(t_cam *c)
{
c->liveview = 0;
c->liveview_fps = 30;
c->liveview_fps_time = 1000000 / 30;
pthread_mutex_init(&c->liveview_mutex, NULL);
pthread_cond_init(&c->liveview_condvar, NULL);
c->folder_path = strdup("/tmp/");
c->camera_value_list = NULL;
<API key>(c->context, (GPContextErrorFunc)error_func, NULL);
<API key>(c->context, (<API key>)message_func, NULL);
gp_camera_new(&c->camera);
c->context = gp_context_new();
printf("Camera Init\n");
c->ret = gp_camera_init(c->camera, c->context);
if (c->ret != GP_OK) {
printf("gp_camera_init: %d\n", c->ret);
return (GP_ERROR);
}
/* <API key>(t_cam *c); */
return (GP_OK);
}
void generic_exec(t_cam *c, char *command, char **param)
{
char *msg = NULL;
if (command && strncmp(command, "get_", 4) == 0)
{
command = &command[4];
get_config(command, c);
return;
}
if (param)
{
if (param[0])
set_config(command, param[0], c);
}
else
{
asprintf(&msg, "bad parameters for %s", command);
<API key>(BAD_PARAMETERS, NULL, NULL, msg, c);
}
}
int exec_command(t_cam *c, char *command, char **param)
{
t_func *tmp = NULL;
int flag = 0;
if (strcmp(command, "liveview") != 0 && c->liveview == 1)
{
printf("enter inside here\n");
c->liveview = 0;
flag = 1;
sleep(1);
}
tmp = c->first_func_ptr;
while (tmp != NULL)
{
if (strcmp(command, tmp->name) == 0)
{
tmp->func_ptr(c, param);
break;
}
tmp = tmp->next;
}
if (tmp == NULL)
generic_exec(c, command, param);
if (flag == 1)
liveview(c, NULL);
return (0);
}
void add_func_ptr_list(t_cam *c, char *name, int (*func_ptr)(t_cam *c, char **param))
{
t_func *tmp;
if (c->first_func_ptr == NULL)
{
c->first_func_ptr = malloc(sizeof(*c->first_func_ptr));
tmp = c->first_func_ptr;
tmp->next = NULL;
tmp->func_ptr = func_ptr;
tmp->name = strdup(name);
c->first_func_ptr = tmp;
}
else
{
tmp = c->first_func_ptr;
while (tmp->next != NULL)
tmp = tmp->next;
tmp->next = malloc(sizeof(*tmp->next));
tmp = tmp->next;
tmp->next = NULL;
tmp->func_ptr = func_ptr;
tmp->name = strdup(name);
}
}
int main(int ac, char **av)
{
t_cam *c;
ac = ac;
av = av;
#ifdef __APPLE__
//pthread_t thread;
printf("Killing PTPCamera process\n");
system("killall PTPCamera");
//pthread_create(&thread, NULL, initUSBDetect, (void *)c);
#endif
signal_inib();
c = malloc(sizeof(*c));
c->first_func_ptr = NULL;
init(c);
<API key>(c);
add_func_ptr_list(c, "capture", trigger_capture);
add_func_ptr_list(c, "liveview", liveview);
add_func_ptr_list(c, "auto_focus", auto_focus);
add_func_ptr_list(c, "liveviewfps", liveviewfps);
add_func_ptr_list(c, "get_liveviewfps", get_liveviewfps);
add_func_ptr_list(c, "defaultpath", <API key>);
add_func_ptr_list(c, "get_defaultpath", <API key>);
pthread_create(&c->liveview_thread, NULL, liveview_launcher, (void*)c);
init_comm(c, UNIX_SOCKET_PATH);
gp_camera_exit(c->camera, c->context);
return (0);
}
|
<!
~ Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
~
~ This program is free software; you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation; either version 3 of the License, or (at your option)
~ any later version.
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program; if not, see http:
<html>
<head>
<title>Sentinel-2 Toolbox Help - Export Color Legend</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../style.css">
</head>
<body>
<table class="header">
<tr class="header">
<td class="header">
Export Color Legend</td>
<td class="header" align="right"><a href="../general/BeamOverview.html"><img src="../images/snap_header.jpg" border="0" ></a></td>
</tr>
</table>
<h4>Exporting a Color Legend Image</h4>
<p>
For non-RGB images it is possible to export the current colour palette setting as a colour legend image.
This function is available from the context menu over non-RGB images.
The menu item <i>Export Color Legend</i> brings up a file chooser dialog allowing you to select
the file name for the exported legend image. The legend appearance can be modified by opening the
<i>Properties...</i> button in the file chooser:
</p>
<p align="center"> <img src="images/<API key>.png" width="370" height="313">
</p>
<p>Note that the tranparency mode is only enabled for the image types TIFF and PNG. A preview dialog
for the legend image can be opened by clicking the <i>Preview...</i> button. Within the dialog
it is also possible to copy the colour legend image the the system clipboard by using the context menu
over the image area:
</p>
<p align="center"> <img src="images/ColorLegendPreview.png" width="492" height="194">
</p>
<hr>
</body>
</html>
|
#include <firstinclude.h>
#include <stdlib.h> // for malloc(3), free(3), EXIT_SUCCESS
#include <iostream> // for std::cout, std::endl
/*
* This example shows how to use the C++ operator new placement
* operator.
*
* Things we learn:
* 1. How to write your own placement function.
* 2. Regular constructor gets called after the placement.
* 3. Releasing of space could be overridden too.
* 4. This could be used for caching and real time considerations for instance.
* 5. Even if you allocate an array the delete[] is NOT called so
* your regular delete operator needs to know how to do the job
* both for arrays and for single elements (if you want arrays
* at all that is...).
*
* TODO:
* - show in place construction (calling the constructor on an otherwise
* allocated block of ram)
*/
class A {
public:
float val;
A(void) {
val=-7.6;
}
A(double ival) {
val=ival;
}
void *operator new(size_t size, double val) {
std::cout << "in new operator" << std::endl;
std::cout << "size is " << size << std::endl;
void *pointer=malloc(size);
std::cout << "pointer is " << pointer << std::endl;
// next two lines have no effect since the constructor
// will be called and will override it
// A *p=(A *)pointer;
// p->val=val;
return(pointer);
}
// this is for allocating arrays, the size that you get
// is SizeOfObject*NumOfObjects...
void *operator new[] (const size_t size) {
std::cout << "in new[] operator" << std::endl;
std::cout << "size is " << size << std::endl;
void *pointer=malloc(size);
std::cout << "pointer is " << pointer << std::endl;
return(pointer);
}
// notice that this does NOT get called...
void operator delete[] (void *pointer) {
std::cout << "in delete[] operator" << std::endl;
std::cout << "pointer is " << pointer << std::endl;
free(pointer);
}
void* operator new(size_t size) {
std::cout << "in new operator" << std::endl;
std::cout << "size is " << size << std::endl;
// void *pointer=new char[size];
void *pointer=malloc(size);
std::cout << "pointer is " << pointer << std::endl;
return(pointer);
}
void operator delete(void *pointer) {
std::cout << "in delete operator" << std::endl;
std::cout << "pointer is " << pointer << std::endl;
free(pointer);
}
};
int main(int argc, char** argv, char** envp) {
std::cout << "heap no arguments example" << std::endl;
A* a=new A();
std::cout << "a->val is " << a->val << std::endl;
#pragma GCC diagnostic ignored "-<API key>"
delete a;
std::cout << "heap arguments example" << std::endl;
A* b=new(5.5)A();
std::cout << "b->val is " << b->val << std::endl;
#pragma GCC diagnostic ignored "-<API key>"
delete b;
std::cout << "many heap no arguments example" << std::endl;
const unsigned int num_objs=5;
A* e=new A[num_objs];
for(unsigned int i=0; i<num_objs; i++) {
std::cout << i << " " << "e->val is " << e[i].val << std::endl;
}
delete[] e;
// the next two examples are stack examples in which case neither
// the new nor the delete operator will be called (memory is stack
// memory).
// could you write a C++ object which can be used ONLY on the stack
// or conversly ONLY on the heap using this property ?!?
std::cout << "stack no arguments example" << std::endl;
A c;
std::cout << "c.val is " << c.val << std::endl;
std::cout << "stack arguments example" << std::endl;
A d(6.7);
std::cout << "d.val is " << d.val << std::endl;
return EXIT_SUCCESS;
}
|
var Connection = require("./db/db-connection").Connection;
var Tables = require("./db/tables");
const R = require("ramda");
var QUERY_MATCHES = {
$or: [
{percent_name: {$gt: 0.9}},
{
distance: {$lt: 1}
},
{
percent_name: {$gt: 0.8},
distance: {$lt: 30}
},
{
percent_name: {$gt: 0.8},
<API key>: 1,
distance: {$lt: 50}
}
]
};
var connection = new Connection();
connection.connect()
.then(connection.collection.bind(connection, Tables.FUZZY_MATCHES_FB))
.then(coll=> {
return coll.find(QUERY_MATCHES).toArray()
})
.then(matches=> {
var promises = matches.map(match=> {
return Promise.resolve(R.filter(item=>(item.id_p1 == match.id_p1 || item.id_p2 == match.id_p1), matches)).then(response=> {
return {
id: match.id_p1.toString(),
name: match.name_p1,
response: R.compose(
R.sortBy(R.identity),
R.uniq,
R.flatten,
R.map(place=> {
return [place.id_p1.toString(), place.id_p2.toString()]
})
)(response)
}
})
});
return Promise.all(promises);
})
.then(matches=> {
matches = R.groupBy(item=>item.id, matches);
matches = Object.keys(matches).map((key)=> {
var get_ids = R.compose(
R.reduce((prev, id)=> {
prev.id_facebook.push(id);
return prev;
}, {id_facebook: [], id_google: [], id_opendata: [], id_imprese: []}),
R.sortBy(R.identity),
R.uniq,
R.flatten
, R.map(R.prop("response"))
);
var ids = get_ids(matches[key]);
return Object.assign({
name: matches[key][0].name
}, ids)
});
var uniq_matches = [];
for (var i = 0; i < matches.length; i++) {
var match = matches[i];
var found = R.find(nm=> {
var has_fb = match.id_facebook.filter(id=>nm.id_facebook.includes(id)).length;
return has_fb;
})(uniq_matches);
if (!found) {
uniq_matches.push(match);
}else {
found.id_facebook=R.uniq(found.id_facebook.concat(match.id_facebook));
}
}
var fuzzyMatchColl = connection.db.collection(Tables.<API key>);
return fuzzyMatchColl.drop().then(_=>{
return fuzzyMatchColl.insertMany(uniq_matches);
})
})
.then(_=> {
connection.db.close();
console.log("DONE");
process.exit(0);
})
.catch(_=> {
console.log(_);
connection.db.close();
process.exit(1);
});
|
// Includes
#include "include/mdShared.h"
#include "include/mdBreakPoint.h"
#include "include/mdSpy.h"
#include "include/mdSymbol.h"
#include "include/mdSymbolPair.h"
#include "include/mdListLine.h"
#include "include/mdSection.h"
#include "include/mdSpiesPanel.h"
#include "include/mdFrmMain.h"
#include "include/mdApp.h"
#include "include/mdEmu.h"
#include "include/mdProject.h"
// Events
mdProject::mdProject()
{
AddDefaultSymbols();
}
mdProject::~mdProject()
{
ClearAllSpies();
ClearAllBreakPoints();
ClearAllSymbols();
}
// Gestion des symboles
void mdProject::AddDefaultSymbols()
{
wxString b;
b=_T("VDP_DATA");
InsertSymbol(NULL,b,0xc00000,0,false);
b=_T("VDP_DATA");
InsertSymbol(NULL,b,0xc00002,0,false);
b=_T("VDP_CTRL");
InsertSymbol(NULL,b,0xc00004,0,false);
b=_T("VDP_CTRL");
InsertSymbol(NULL,b,0xc00006,0,false);
b=_T("HV_COUNTER");
InsertSymbol(NULL,b,0xc00008,0,false);
b=_T("HV_COUNTER");
InsertSymbol(NULL,b,0xc0000a,0,false);
b=_T("HV_COUNTER");
InsertSymbol(NULL,b,0xc0000c,0,false);
b=_T("HV_COUNTER");
InsertSymbol(NULL,b,0xc0000e,0,false);
b=_T("SN76489_PSG");
InsertSymbol(NULL,b,0xc00011,0,false);
b=_T("SN76489_PSG");
InsertSymbol(NULL,b,0xc00013,0,false);
b=_T("SN76489_PSG");
InsertSymbol(NULL,b,0xc00015,0,false);
b=_T("SN76489_PSG");
InsertSymbol(NULL,b,0xc00017,0,false);
b=_T("Z80_BUSREQ");
InsertSymbol(NULL,b,0xa11100,0,false);
b=_T("Z80_RESET");
InsertSymbol(NULL,b,0xa11200,0,false);
b=_T("MD_VERSION");
InsertSymbol(NULL,b,0xa10001,0,false);
b=_T("DATA_PORT_A");
InsertSymbol(NULL,b,0xa10003,0,false);
b=_T("DATA_PORT_B");
InsertSymbol(NULL,b,0xa10005,0,false);
b=_T("DATA_PORT_C");
InsertSymbol(NULL,b,0xa10007,0,false);
b=_T("CTRL_PORT_A");
InsertSymbol(NULL,b,0xa10009,0,false);
b=_T("CTRL_PORT_B");
InsertSymbol(NULL,b,0xa1000b,0,false);
b=_T("CTRL_PORT_C");
InsertSymbol(NULL,b,0xa1000d,0,false);
b=_T("TxDATA_PORT_A");
InsertSymbol(NULL,b,0xa10000,0,false);
b=_T("RxDATA_PORT_A");
InsertSymbol(NULL,b,0xa10011,0,false);
b=_T("S_CTRL_PORT_A");
InsertSymbol(NULL,b,0xa10013,0,false);
b=_T("TxDATA_PORT_B");
InsertSymbol(NULL,b,0xa10015,0,false);
b=_T("RxDATA_PORT_B");
InsertSymbol(NULL,b,0xa10017,0,false);
b=_T("S_CTRL_PORT_B");
InsertSymbol(NULL,b,0xa10019,0,false);
b=_T("TxDATA_PORT_C");
InsertSymbol(NULL,b,0xa1001b,0,false);
b=_T("RxDATA_PORT_C");
InsertSymbol(NULL,b,0xa1001d,0,false);
b=_T("S_CTRL_PORT_C");
InsertSymbol(NULL,b,0xa1001f,0,false);
DumpFile_Rom=_T("");
DumpFile_68kRam=_T("");
DumpFile_Z80Ram=_T("");
DumpFile_CRam=_T("");
DumpFile_VRam=_T("");
DumpFile_VSRam=_T("");
}
void mdProject::ClearAllSymbols(void)
{
mdSymbolList::iterator it;
for( it = m_Symbols.begin(); it != m_Symbols.end(); ++it )
{ mdSymbolPair *s=(mdSymbolPair*) it->second;
if(s!=NULL)
{
if(s->Label!=NULL)
delete(s->Label);
if(s->Variable!=NULL)
delete(s->Variable);
delete(s);
}
}
m_Symbols.clear();
}
int mdProject::CountSymbols(void)
{
return m_Symbols.size();
}
mdSymbol* mdProject::GetSymbol(int type,int pc)
{
mdSymbolPair *sp=GetSymbolPair(pc);
if(sp!=NULL)
{ if(type==0)
return sp->Variable;
else
return sp->Label;
}
return NULL;
}
mdSymbolPair* mdProject::GetSymbolPair(int pc)
{
mdSymbolList::iterator it;
it=m_Symbols.find(pc);
if(it!=m_Symbols.end())
{ return (mdSymbolPair*) it->second;
}
return NULL;
}
mdSymbol* mdProject::InsertSymbol(mdSection *Section_ID,wxString &Name,unsigned int Address,int Type,bool UserCreated)
{
mdSymbol *s=new mdSymbol();
s->Section=Section_ID;
s->Address=Address;
s->Name=Name;
s->UserCreated=UserCreated;
mdSymbolPair *sp=GetSymbolPair(Address);
if(sp==NULL)
{ sp=new mdSymbolPair();
if(Type==0)
sp->Variable=s;
else
sp->Label=s;
m_Symbols[Address]=sp;
}
else
{ if(Type==0)
{ if(sp->Variable!=NULL)
delete(sp->Variable);
sp->Variable=s;
}
else
{ if(sp->Label!=NULL)
delete(sp->Label);
sp->Label=s;
}
}
return s;
}
bool mdProject::<API key>(int pc)
{
mdBreakPointList::iterator it;
it=m_BreakPoints.find(pc);
if(it!=m_BreakPoints.end())
return true;
return false;
}
char* mdProject::GetSymbolName(int pc)
{
mdSymbolPair *sp=NULL;
mdSymbolList::iterator it;
it=m_Symbols.find(pc);
if(it!=m_Symbols.end())
{ sp=(mdSymbolPair*) it->second;
if(sp->Label!=NULL)
return (char*)sp->Label->Name.c_str();
if(sp->Variable!=NULL)
return (char*)sp->Variable->Name.c_str();
}
return NULL;
}
char* mdProject::GetSymbolLabelName(int pc)
{
mdSymbolPair *sp=NULL;
mdSymbolList::iterator it;
it=m_Symbols.find(pc);
if(it!=m_Symbols.end())
{ sp=(mdSymbolPair*) it->second;
if(sp->Label!=NULL)
return (char*)sp->Label->Name.c_str();
else
{
if(sp->Variable!=NULL)
return (char*)sp->Variable->Name.c_str();
}
}
return NULL;
}
char* mdProject::<API key>(int pc)
{
mdSymbolPair *sp=NULL;
mdSymbolList::iterator it;
it=m_Symbols.find(pc);
if(it!=m_Symbols.end())
{ sp=(mdSymbolPair*) it->second;
if(sp->Variable!=NULL)
return (char*)sp->Variable->Name.c_str();
}
return NULL;
}
void mdProject::RemoveSymbol(int type,int pc)
{
//m_Spies.erase(IntIndex);
mdSymbolPair *sp=GetSymbolPair(pc);
if(sp!=NULL)
{
if(type==0)
{ if(sp->Variable!=NULL)
{ if(sp->Variable->UserCreated==true)
{ delete(sp->Variable);
sp->Variable=NULL;
}
}
}
if(type==1)
{ if(sp->Label!=NULL)
{ delete(sp->Label);
sp->Label=NULL;
}
}
if(sp->Label==NULL && sp->Variable==NULL)
{ m_Symbols.erase(pc);
delete(sp);
}
}
}
// Gestion des watchers
mdSpy* mdProject::InsertSpy( int IntIndex,
mdSection *Section,
wxString &name,
unsigned int address,
int length,
bool isfromarray)
{
mdSpy *Spy=new mdSpy();
Spy->SetName(name);
Spy->SetAddress(address,true);
Spy->m_Symbol->Section=Section;
Spy->m_Length=length;
Spy->m_ListIndex=IntIndex;
Spy->m_IsFromArray=isfromarray;
Spy->m_Value=0;
m_Spies[IntIndex]=Spy;
return Spy;
}
mdSpy* mdProject::GetSpy(int IntIndex)
{ return (mdSpy*)m_Spies[IntIndex];
}
void mdProject::RemoveSpy(int IntIndex)
{
m_Spies.erase(IntIndex);
}
void mdProject::ClearAllSpies(void)
{
mdSpiesList::iterator it;
for( it = m_Spies.begin(); it != m_Spies.end(); ++it )
{ mdSpy *s=(mdSpy*) it->second;
if(s!=NULL)
delete(s);
}
m_Spies.clear();
}
int mdProject::CountSpies(void)
{
return m_Spies.size();
}
// Gestion des BerakPoints
mdBreakPoint* mdProject::InsertBreakPoint(int IntIndex)
{
mdBreakPointList::iterator it;
it=m_BreakPoints.find(IntIndex);
if(it==m_BreakPoints.end())
{ mdBreakPoint *bk=new mdBreakPoint();
bk->m_Hits=0;
bk->m_Enabled=TRUE;
m_BreakPoints[IntIndex]=bk;
return bk;
}
return NULL;
}
bool mdProject::CheckGotBreakPoint(int pc)
{
mdBreakPointList::iterator it;
it=m_BreakPoints.find(pc);
if(it!=m_BreakPoints.end())
return true;
return false;
}
void mdProject::RemoveBreakPoint(int IntIndex)
{
m_BreakPoints.erase(IntIndex);
}
int mdProject::CountBreakPoint(void)
{
return m_BreakPoints.size();
}
void mdProject::ClearAllBreakPoints(void)
{
mdBreakPointList::iterator it;
for( it = m_BreakPoints.begin(); it != m_BreakPoints.end(); ++it )
{ mdBreakPoint *s=(mdBreakPoint*) it->second;
if(s!=NULL)
delete(s);
}
m_BreakPoints.clear();
}
mdBreakPoint* mdProject::GetBreakPoint(int pc)
{
return(mdBreakPoint*) m_BreakPoints[pc];
}
int mdProject::ExecuteBreakPoint(int pc)
{
mdBreakPointList::iterator it;
it=m_BreakPoints.find(pc);
if(it!=m_BreakPoints.end())
{
mdBreakPoint *value =(mdBreakPoint*) it->second;
if(value->m_Enabled==true)
{ value->m_Hits++;
return 1;
}
}
return 0;
}
int mdProject::LoadSymbols(int type,wxString& FileName)
{
// nasm pour commencer
wxString str="";
wxTextFile file;
file.Open(FileName);
int etat=-1;
int ligne_cnt=0;
wxString Section="";
ClearAllSymbols();
AddDefaultSymbols();
for ( str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine() )
{
if(ligne_cnt==0)
{
switch(etat)
{
case -1:
{
// traite le fichier
if(str.Contains(" Section ")==true)
{ // doit virer
etat=1;
Section=str.BeforeLast('\'');
Section=Section.AfterFirst('\'');
ligne_cnt=5;
}
else
{
if(str.Contains("Value Type Class Symbol Refs Line File")==true)
{ etat=1;
Section=_T("");
ligne_cnt=2;
}
}
}break;
case 1:
{
if(str.Trim().Length()==0)
etat=-1;
else
{ wxString var_name="";
wxString taille=str.SubString(12,18);
wxString index=str.SubString(0,9);
long value=0;
int addr_index= index.ToLong(&value,16);
int addresse=value;
taille=taille.Trim();
var_name=str.SubString(25,48);
var_name=var_name.Trim(true);
if(taille.Trim().Length()>0)
{
int size=0;
if(taille.CmpNoCase("byte")==0)
{ size=1;
}
if(taille.CmpNoCase("word")==0)
{ size=2;
}
if(taille.CmpNoCase("long")==0)
{ size=4;
}
if(size>0)
{
if(Section.CmpNoCase("vars")==0)
{ addresse = 0xff0000 + value; }
// attribue une section
gFrmMain->GetSpiesPanel()->InsertSpy(NULL,var_name,addresse,size,1,false);
}
}
else
{
InsertSymbol(NULL,var_name,value,1,false);
}
}
}break;
}
}
else
{ ligne_cnt
}
file.Close();
return 0;
}
int mdProject::LoadList(wxString& FileName)
{
/ nasm pour commencer
//wxString str="";
//wxTextFile file;
//file.Open(FileName);
//int nbligne=file.GetLineCount();
//for ( str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine() )
// wxString *s=new wxString(str);
//file.Close();
return 0;
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Sat Oct 28 21:24:43 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class fr.cryptohash.CubeHashCore (burstcoin 1.3.6cg API)</title>
<meta name="date" content="2017-10-28">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class fr.cryptohash.CubeHashCore (burstcoin 1.3.6cg API)";
}
}
catch(err) {
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?fr/cryptohash/class-use/CubeHashCore.html" target="_top">Frames</a></li>
<li><a href="CubeHashCore.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<h2 title="Uses of Class fr.cryptohash.CubeHashCore" class="title">Uses of Class<br>fr.cryptohash.CubeHashCore</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">CubeHashCore</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#fr.cryptohash">fr.cryptohash</a></td>
<td class="colLast">
<div class="block">The <code>fr.cryptohash</code> package contains implementations of
various cryptographic hash functions.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="fr.cryptohash">
</a>
<h3>Uses of <a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">CubeHashCore</a> in <a href="../../../fr/cryptohash/package-summary.html">fr.cryptohash</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">CubeHashCore</a> in <a href="../../../fr/cryptohash/package-summary.html">fr.cryptohash</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../fr/cryptohash/CubeHash224.html" title="class in fr.cryptohash">CubeHash224</a></span></code>
<div class="block">This class implements the CubeHash-224 digest algorithm under the
<a href="../../../fr/cryptohash/Digest.html" title="interface in fr.cryptohash"><code>Digest</code></a> API.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../fr/cryptohash/CubeHash256.html" title="class in fr.cryptohash">CubeHash256</a></span></code>
<div class="block">This class implements the CubeHash-256 digest algorithm under the
<a href="../../../fr/cryptohash/Digest.html" title="interface in fr.cryptohash"><code>Digest</code></a> API.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../fr/cryptohash/CubeHash384.html" title="class in fr.cryptohash">CubeHash384</a></span></code>
<div class="block">This class implements the CubeHash-384 digest algorithm under the
<a href="../../../fr/cryptohash/Digest.html" title="interface in fr.cryptohash"><code>Digest</code></a> API.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../fr/cryptohash/CubeHash512.html" title="class in fr.cryptohash">CubeHash512</a></span></code>
<div class="block">This class implements the CubeHash-512 digest algorithm under the
<a href="../../../fr/cryptohash/Digest.html" title="interface in fr.cryptohash"><code>Digest</code></a> API.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../fr/cryptohash/package-summary.html">fr.cryptohash</a> with parameters of type <a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">CubeHashCore</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../fr/cryptohash/Digest.html" title="interface in fr.cryptohash">Digest</a></code></td>
<td class="colLast"><span class="typeNameLabel">CubeHashCore.</span><code><span class="memberNameLink"><a href="../../../fr/cryptohash/CubeHashCore.html#copyState-fr.cryptohash.CubeHashCore-">copyState</a></span>(<a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">CubeHashCore</a> dst)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../fr/cryptohash/CubeHashCore.html" title="class in fr.cryptohash">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?fr/cryptohash/class-use/CubeHashCore.html" target="_top">Frames</a></li>
<li><a href="CubeHashCore.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip.navbar.bottom">
</a></div>
<p class="legalCopy"><small>Copyright &
</body>
</html>
|
package org.luwrain.core;
import java.util.*;
class ShortcutManager
{
class Entry
{
String name = "";
Shortcut shortcut;
Entry(String name, Shortcut shortcut)
{
NullCheck.notNull(name, "name");
NullCheck.notNull(shortcut, "shortcut");
if (name.trim().isEmpty())
throw new <API key>("name may not be empty");
this.name = name;
this.shortcut = shortcut;
}
}
private final TreeMap<String, Entry> shortcuts = new TreeMap<String, Entry>();
boolean add(Shortcut shortcut)
{
NullCheck.notNull(shortcut, "shortcut");
final String name = shortcut.getName();
if (name == null || name.trim().isEmpty())
return false;
if (shortcuts.containsKey(name))
return false;
shortcuts.put(name, new Entry(name, shortcut));
return true;
}
Application[] prepareApp(String name, String[] args)
{
NullCheck.notNull(name, "name");
NullCheck.notNullItems(args, "args");
if (name.trim().isEmpty())
throw new <API key>("name may not be empty");
if (!shortcuts.containsKey(name))
return null;
return shortcuts.get(name).shortcut.prepareApp(args);
}
String[] getShortcutNames()
{
final Vector<String> res = new Vector<String>();
for(Map.Entry<String, Entry> e: shortcuts.entrySet())
res.add(e.getKey());
String[] str = res.toArray(new String[res.size()]);
Arrays.sort(str);
return str;
}
void addBasicShortcuts()
{
add(new Shortcut(){
@Override public String getName()
{
return "registry";
}
@Override public Application[] prepareApp(String[] args)
{
Application[] res = new Application[1];
res[0] = new org.luwrain.app.registry.RegistryApp();
return res;
}
});
}
void addOsShortcuts(Luwrain luwrain, Registry registry)
{
NullCheck.notNull(luwrain, "luwrain");
NullCheck.notNull(registry, "registry");
registry.addDirectory(Settings.OS_SHORTCUTS_PATH);
for(String s: registry.getDirectories(Settings.OS_SHORTCUTS_PATH))
{
if (s.trim().isEmpty())
continue;
final OsCommands.OsShortcut shortcut = new OsCommands.OsShortcut(luwrain);
if (shortcut.init(Settings.createOsShortcut(registry, Registry.join(Settings.OS_SHORTCUTS_PATH, s))))
add(shortcut);
}
}
}
|
ID: 2
post_title: Sample Page
author: moises
post_date: 2016-12-14 02:19:15
post_excerpt: ""
layout: page
permalink: http://pepmeup.ie/sample-page/
published: true
This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
<blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)</blockquote>
or something like this:
<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
As a new WordPress user, you should go to <a href="http:/wordpress/wp-admin/">your dashboard</a> to delete this page and create new pages for your content. Have fun!
|
Namespace Interpreter.Parser.Tokens
''' <summary>
'''
''' </summary>
Public Class [Operator] : Inherits Token
Public Enum Operators As Integer
NULL = -1
''' <summary>
''' <- Assign value to variable;
''' </summary>
ValueAssign
''' <summary>
''' -> Extension method calling;
''' </summary>
ExtCall
''' <summary>
''' <= Collection and hash table operations;
''' </summary>
<API key>
''' <summary>
''' = Self type cast;
''' </summary>
SelfCast
''' <summary>
''' << Hybrids scripting;
''' </summary>
HybridsScript
''' <summary>
''' >> Setup variable of hybrids scripting;
''' </summary>
HybirdsScriptPush
''' <summary>
HashOprOrDelegate
''' <summary>
''' <
''' </summary>
DynamicsCast
''' <summary>
IODevice
End Enum
Public ReadOnly Property Type As [Operator].Operators
Public Overrides ReadOnly Property TokenType As TokenTypes
Get
Return TokenTypes.Operator
End Get
End Property
''' <summary>
'''
''' </summary>
''' <param name="opr">
''' [<- Assign value to variable;]
'''
''' [<= Collection and hash table operations;]
'''
''' [<< Hybrids scripting;]
'''
Sub New(opr As String)
Call MyBase.New(0, opr)
Type = GetOperator(opr)
End Sub
Public Shared Function GetOperator(opr As String) As Operators
Select Case Trim(opr)
Case "<-", "=" : Return Operators.ValueAssign
Case "->" : Return Operators.ExtCall
Case "<=" : Return Operators.<API key>
' Case "=" : Return Operators.ValueAssign
Case "<<" : Return Operators.HybridsScript
Case ">>" : Return Operators.HybirdsScriptPush
Case "=>" : Return Operators.HashOprOrDelegate
Case "<" : Return Operators.DynamicsCast
Case ">" : Return Operators.IODevice
Case Else
Return Operators.NULL
' Throw New <API key>($"The operator {NameOf(opr)}:={opr} is currently not support yet!")
End Select
End Function
Public Overrides Function ToString() As String
Return $"( {_TokenValue } ) {Type.GetType.FullName}.{Type.ToString}"
End Function
End Class
End Namespace
|
#include "tool_move.hpp"
#include "document/idocument_board.hpp"
#include "board/board.hpp"
#include "document/idocument_package.hpp"
#include "pool/package.hpp"
#include "document/idocument_padstack.hpp"
#include "pool/padstack.hpp"
#include "document/idocument_schematic.hpp"
#include "schematic/schematic.hpp"
#include "document/idocument_symbol.hpp"
#include "pool/symbol.hpp"
#include "imp/imp_interface.hpp"
#include "util/accumulator.hpp"
#include "util/util.hpp"
#include <iostream>
#include "core/tool_id.hpp"
namespace horizon {
ToolMove::ToolMove(IDocument *c, ToolID tid) : ToolBase(c, tid), ToolHelperMove(c, tid), ToolHelperMerge(c, tid)
{
}
void ToolMove::expand_selection()
{
std::set<SelectableRef> pkgs_fixed;
std::set<SelectableRef> new_sel;
for (const auto &it : selection) {
switch (it.type) {
case ObjectType::LINE: {
Line *line = doc.r->get_line(it.uuid);
new_sel.emplace(line->from.uuid, ObjectType::JUNCTION);
new_sel.emplace(line->to.uuid, ObjectType::JUNCTION);
} break;
case ObjectType::POLYGON_EDGE: {
Polygon *poly = doc.r->get_polygon(it.uuid);
auto vs = poly-><API key>(it.vertex);
new_sel.emplace(poly->uuid, ObjectType::POLYGON_VERTEX, vs.first);
new_sel.emplace(poly->uuid, ObjectType::POLYGON_VERTEX, vs.second);
} break;
case ObjectType::NET_LABEL: {
auto &la = doc.c->get_sheet()->net_labels.at(it.uuid);
new_sel.emplace(la.junction->uuid, ObjectType::JUNCTION);
} break;
case ObjectType::BUS_LABEL: {
auto &la = doc.c->get_sheet()->bus_labels.at(it.uuid);
new_sel.emplace(la.junction->uuid, ObjectType::JUNCTION);
} break;
case ObjectType::POWER_SYMBOL: {
auto &ps = doc.c->get_sheet()->power_symbols.at(it.uuid);
new_sel.emplace(ps.junction->uuid, ObjectType::JUNCTION);
} break;
case ObjectType::BUS_RIPPER: {
auto &rip = doc.c->get_sheet()->bus_rippers.at(it.uuid);
new_sel.emplace(rip.junction->uuid, ObjectType::JUNCTION);
} break;
case ObjectType::LINE_NET: {
auto line = &doc.c->get_sheet()->net_lines.at(it.uuid);
for (auto &it_ft : {line->from, line->to}) {
if (it_ft.is_junc()) {
new_sel.emplace(it_ft.junc.uuid, ObjectType::JUNCTION);
}
}
} break;
case ObjectType::TRACK: {
auto track = &doc.b->get_board()->tracks.at(it.uuid);
for (auto &it_ft : {track->from, track->to}) {
if (it_ft.is_junc()) {
new_sel.emplace(it_ft.junc.uuid, ObjectType::JUNCTION);
}
}
} break;
case ObjectType::VIA: {
auto via = &doc.b->get_board()->vias.at(it.uuid);
new_sel.emplace(via->junction->uuid, ObjectType::JUNCTION);
} break;
case ObjectType::POLYGON: {
auto poly = doc.r->get_polygon(it.uuid);
int i = 0;
for (const auto &itv : poly->vertices) {
(void)sizeof itv;
new_sel.emplace(poly->uuid, ObjectType::POLYGON_VERTEX, i);
i++;
}
} break;
case ObjectType::ARC: {
Arc *arc = doc.r->get_arc(it.uuid);
new_sel.emplace(arc->from.uuid, ObjectType::JUNCTION);
new_sel.emplace(arc->to.uuid, ObjectType::JUNCTION);
new_sel.emplace(arc->center.uuid, ObjectType::JUNCTION);
} break;
case ObjectType::SCHEMATIC_SYMBOL: {
auto sym = doc.c-><API key>(it.uuid);
for (const auto &itt : sym->texts) {
new_sel.emplace(itt->uuid, ObjectType::TEXT);
}
} break;
case ObjectType::BOARD_PACKAGE: {
BoardPackage *pkg = &doc.b->get_board()->packages.at(it.uuid);
if (pkg->fixed) {
pkgs_fixed.insert(it);
}
else {
for (const auto &itt : pkg->texts) {
new_sel.emplace(itt->uuid, ObjectType::TEXT);
}
}
} break;
default:;
}
}
selection.insert(new_sel.begin(), new_sel.end());
if (pkgs_fixed.size() && imp)
imp->tool_bar_flash("can't move fixed package");
for (auto it = selection.begin(); it != selection.end();) {
if (pkgs_fixed.count(*it))
it = selection.erase(it);
else
++it;
}
}
Coordi ToolMove::<API key>()
{
Accumulator<Coordi> accu;
std::set<SelectableRef> items_ignore;
for (const auto &it : selection) {
if (it.type == ObjectType::BOARD_PACKAGE) {
const auto &pkg = doc.b->get_board()->packages.at(it.uuid);
for (auto &it_txt : pkg.texts) {
items_ignore.emplace(it_txt->uuid, ObjectType::TEXT);
}
}
else if (it.type == ObjectType::SCHEMATIC_SYMBOL) {
const auto &sym = doc.c->get_sheet()->symbols.at(it.uuid);
for (auto &it_txt : sym.texts) {
items_ignore.emplace(it_txt->uuid, ObjectType::TEXT);
}
}
}
for (const auto &it : selection) {
if (items_ignore.count(it))
continue;
switch (it.type) {
case ObjectType::JUNCTION:
accu.accumulate(doc.r->get_junction(it.uuid)->position);
break;
case ObjectType::HOLE:
accu.accumulate(doc.r->get_hole(it.uuid)->placement.shift);
break;
case ObjectType::BOARD_HOLE:
accu.accumulate(doc.b->get_board()->holes.at(it.uuid).placement.shift);
break;
case ObjectType::SYMBOL_PIN:
accu.accumulate(doc.y->get_symbol_pin(it.uuid).position);
break;
case ObjectType::SCHEMATIC_SYMBOL:
accu.accumulate(doc.c-><API key>(it.uuid)->placement.shift);
break;
case ObjectType::BOARD_PACKAGE:
accu.accumulate(doc.b->get_board()->packages.at(it.uuid).placement.shift);
break;
case ObjectType::PAD:
accu.accumulate(doc.k->get_package().pads.at(it.uuid).placement.shift);
break;
case ObjectType::TEXT:
accu.accumulate(doc.r->get_text(it.uuid)->placement.shift);
break;
case ObjectType::POLYGON_VERTEX:
accu.accumulate(doc.r->get_polygon(it.uuid)->vertices.at(it.vertex).position);
break;
case ObjectType::DIMENSION:
if (it.vertex < 2) {
auto dim = doc.r->get_dimension(it.uuid);
accu.accumulate(it.vertex == 0 ? dim->p0 : dim->p1);
}
break;
case ObjectType::POLYGON_ARC_CENTER:
accu.accumulate(doc.r->get_polygon(it.uuid)->vertices.at(it.vertex).arc_center);
break;
case ObjectType::SHAPE:
accu.accumulate(doc.a->get_padstack().shapes.at(it.uuid).placement.shift);
break;
case ObjectType::BOARD_PANEL:
accu.accumulate(doc.b->get_board()->board_panels.at(it.uuid).placement.shift);
break;
case ObjectType::PICTURE:
accu.accumulate(doc.r->get_picture(it.uuid)->placement.shift);
break;
case ObjectType::BOARD_DECAL:
accu.accumulate(doc.b->get_board()->decals.at(it.uuid).placement.shift);
break;
default:;
}
}
if (doc.c || doc.y)
return (accu.get() / 1.25_mm) * 1.25_mm;
else
return accu.get();
}
ToolResponse ToolMove::begin(const ToolArgs &args)
{
std::cout << "tool move\n";
move_init(args.coords);
Coordi selection_center;
if (tool_id == ToolID::ROTATE_CURSOR || tool_id == ToolID::MIRROR_CURSOR)
selection_center = args.coords;
else
selection_center = <API key>();
collect_nets();
if (tool_id == ToolID::ROTATE || tool_id == ToolID::MIRROR_X || tool_id == ToolID::MIRROR_Y
|| tool_id == ToolID::ROTATE_CURSOR || tool_id == ToolID::MIRROR_CURSOR) {
<API key>(selection_center, tool_id == ToolID::ROTATE || tool_id == ToolID::ROTATE_CURSOR);
if (tool_id == ToolID::MIRROR_Y) {
<API key>(selection_center, true);
<API key>(selection_center, true);
}
finish();
return ToolResponse::commit();
}
if (tool_id == ToolID::MOVE_EXACTLY) {
if (auto r = imp->dialogs.ask_datum_coord("Move exactly")) {
move_do(*r);
finish();
return ToolResponse::commit();
}
else {
return ToolResponse::end();
}
}
imp-><API key>({
{InToolActionID::LMB},
{InToolActionID::RMB},
{InToolActionID::ROTATE, InToolActionID::MIRROR, "rotate/mirror"},
{InToolActionID::ROTATE_CURSOR, InToolActionID::MIRROR_CURSOR, "rotate/mirror around cursor"},
{InToolActionID::RESTRICT},
});
update_tip();
for (const auto &it : selection) {
if (it.type == ObjectType::POLYGON_VERTEX || it.type == ObjectType::POLYGON_EDGE) {
auto poly = doc.r->get_polygon(it.uuid);
if (auto plane = dynamic_cast<Plane *>(poly->usage.ptr)) {
planes.insert(plane);
}
}
}
for (auto plane : planes) {
plane->fragments.clear();
plane->revision++;
}
InToolActionID action = InToolActionID::NONE;
switch (tool_id) {
case ToolID::MOVE_KEY_FINE_UP:
action = InToolActionID::MOVE_UP_FINE;
break;
case ToolID::MOVE_KEY_UP:
action = InToolActionID::MOVE_UP;
break;
case ToolID::MOVE_KEY_FINE_DOWN:
action = InToolActionID::MOVE_DOWN_FINE;
break;
case ToolID::MOVE_KEY_DOWN:
action = InToolActionID::MOVE_DOWN;
break;
case ToolID::MOVE_KEY_FINE_LEFT:
action = InToolActionID::MOVE_LEFT_FINE;
break;
case ToolID::MOVE_KEY_LEFT:
action = InToolActionID::MOVE_LEFT;
break;
case ToolID::MOVE_KEY_FINE_RIGHT:
action = InToolActionID::MOVE_RIGHT_FINE;
break;
case ToolID::MOVE_KEY_RIGHT:
action = InToolActionID::MOVE_RIGHT;
break;
default:;
}
if (action != InToolActionID::NONE) {
is_key = true;
ToolArgs args2;
args2.type = ToolEventType::ACTION;
args2.action = action;
update(args2);
}
if (tool_id == ToolID::MOVE_KEY)
is_key = true;
imp-><API key>("Move");
return ToolResponse();
}
void ToolMove::collect_nets()
{
for (const auto &it : selection) {
switch (it.type) {
case ObjectType::BOARD_PACKAGE: {
BoardPackage *pkg = &doc.b->get_board()->packages.at(it.uuid);
for (const auto &itt : pkg->package.pads) {
if (itt.second.net)
nets.insert(itt.second.net->uuid);
}
} break;
case ObjectType::JUNCTION: {
auto ju = doc.r->get_junction(it.uuid);
if (ju->net)
nets.insert(ju->net->uuid);
} break;
default:;
}
}
}
bool ToolMove::can_begin()
{
expand_selection();
return selection.size() > 0;
}
void ToolMove::update_tip()
{
auto delta = get_delta();
std::string s = coord_to_string(delta + key_delta, true) + " ";
if (!is_key) {
s += <API key>();
}
imp->tool_bar_set_tip(s);
}
void ToolMove::do_move(const Coordi &d)
{
move_do_cursor(d);
if (doc.b && update_airwires && nets.size()) {
doc.b->get_board()->update_airwires(true, nets);
}
update_tip();
}
void ToolMove::finish()
{
for (const auto &it : selection) {
if (it.type == ObjectType::SCHEMATIC_SYMBOL) {
auto sym = doc.c-><API key>(it.uuid);
doc.c->get_schematic()->autoconnect_symbol(doc.c->get_sheet(), sym);
if (sym->component->connections.size() == 0) {
doc.c->get_schematic()-><API key>(doc.c->get_sheet(), sym);
}
}
}
if (doc.c) {
<API key>();
}
if (doc.b) {
auto brd = doc.b->get_board();
brd->expand_flags = static_cast<Board::ExpandFlags>(Board::EXPAND_AIRWIRES);
brd->airwires_expand = nets;
for (auto plane : planes) {
brd->update_plane(plane);
}
}
}
ToolResponse ToolMove::update(const ToolArgs &args)
{
if (args.type == ToolEventType::MOVE) {
if (!is_key)
do_move(args.coords);
return ToolResponse();
}
else if (args.type == ToolEventType::ACTION) {
if (any_of(args.action, {InToolActionID::LMB, InToolActionID::COMMIT})
|| (is_transient && args.action == InToolActionID::LMB_RELEASE)) {
finish();
return ToolResponse::commit();
}
else if (any_of(args.action, {InToolActionID::RMB, InToolActionID::CANCEL})) {
return ToolResponse::revert();
}
else if (args.action == InToolActionID::RESTRICT) {
cycle_restrict_mode();
do_move(args.coords);
}
else if (any_of(args.action, {InToolActionID::ROTATE, InToolActionID::MIRROR})) {
bool rotate = args.action == InToolActionID::ROTATE;
const auto selection_center = <API key>();
<API key>(selection_center, rotate);
}
else if (any_of(args.action, {InToolActionID::ROTATE_CURSOR, InToolActionID::MIRROR_CURSOR})) {
bool rotate = args.action == InToolActionID::ROTATE_CURSOR;
<API key>(args.coords, rotate);
}
else {
const auto [dir, fine] = dir_from_action(args.action);
if (dir.x || dir.y) {
auto sp = imp->get_grid_spacing();
if (fine)
sp = sp / 10;
key_delta += dir * sp;
move_do(dir * sp);
update_tip();
}
}
}
return ToolResponse();
}
} // namespace horizon
|
#include <cstdlib> // srand()
#include <ctime> // time()
#include "StateManager.hpp"
#include "SDL.hpp"
#include "Log.hpp"
#include "Config.hpp"
#include "GameStateMainMenu.hpp"
#include "GameStateGame.hpp"
#include "GameStateGameOver.hpp"
#include "Window.hpp"
#include "Graphics.hpp"
StateManager::StateManager(int width, int height)
{
SDL::init(30);
Window::init(width, height, "Prototype", "yes");
Graphics::init(Window::screen);
Config::load("config.ini");
if (Config::debugMode)
Log::debugMode(true);
// Here we start the game!
this->currentState = new GameStateMainMenu();
this->currentState->load();
this->sharedInfo = 0;
srand(time(NULL));
}
StateManager::~StateManager()
{
SDL::exit();
if (this->currentState)
{
this->currentState->unload();
delete this->currentState;
}
}
void StateManager::run()
{
bool letsQuit = false;
while (!letsQuit)
{
// The delta time from the last frame
uint32_t delta = SDL::getDelta();
// Normally i'd refresh input right here, but
// each state must do it individually
int whatToDoNow = this->currentState->update(delta);
switch (whatToDoNow)
{
case GameState::CONTINUE:
break;
case GameState::QUIT:
letsQuit = true;
break;
case GameState::GAME_START:
this->sharedInfo = this->currentState->unload();
delete (this->currentState);
this->currentState = new GameStateGame();
this->currentState->load(this->sharedInfo);
break;
case GameState::GAME_OVER:
this->sharedInfo = this->currentState->unload();
delete (this->currentState);
this->currentState = new GameStateGameOver();
this->currentState->load(this->sharedInfo);
break;
default:
break;
}
Window::clear();
this->currentState->render();
Window::refresh();
// Let's wait a bit if the framerate is too low.
SDL::framerateWait();
}
}
|
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
<API key>: true
});
editor.setTheme("ace/theme/eclipse");
editor.getSession().setMode("ace/mode/java");
document.getElementById('editor').style.fontSize = '18px';
editor.<API key>(true);
var codeTemplates = {};
var viewConfig = {
showOutput: false,
showInput: false
};
var prevLang;
function showOutput(output) {
var stdout = '';
var stderr = '';
if (output.status === 0) {
stdout = output.output;
} else if (output.status === 1) {
stderr = '<p class="error">Compiler error !</p>';
stderr += output.error;
} else if (output.status === 2) {
stderr = '<p class="error">Runtime error !</p>';
stderr += output.error;
} else if (output.status === 3) {
stderr = '<p class="error">Timeout !</p>';
stderr += output.error;
}
var out = '';
if (stderr) {
out += '<b>Stderror</b>\n' + stderr;
}
if (stdout) {
out += stdout;
}
if (!viewConfig.showOutput) {
$('#btn-show-output').click();
}
$('#output-p').html(out);
// $('#output-data').show();
// if (!$('#bottom-pane').hasClass('opened')) {
// $('#bottom-pane').addClass('opened');
windowResized();
}
function loadLangs() {
$('#btn-run').prop('disabled', true);
$.ajax({
type: "GET",
url: '/apis/langs'
}).done(function (data) {
showLangs(data);
$('#btn-run').prop('disabled', false);
}).fail(function (data) {
alert("error");
$('#btn-run').prop('disabled', false);
});
}
function showLangs(langs) {
for (var i = 0; i < langs.supportedLangs.length; i++) {
var supportedLang = langs.supportedLangs[i];
$('#lang').append($('<option>', {
value: supportedLang.id,
text: supportedLang.name
}));
codeTemplates[supportedLang.id] = supportedLang.template;
}
$('#lang').val(langs.supportedLangs[0].id);
onLangChanged();
}
$(document).ready(function () {
$('#btn-output').click(function () {
$('#output-data').toggle();
$('#bottom-pane').toggleClass('opened');
windowResized();
});
$('#btn-run').click(function () {
onRunning();
var codeRunRequest = {
lang: $('#lang').find(":selected").val(),
code: editor.getValue(),
input: $('#text-input').val()
};
runCode(codeRunRequest);
// $.ajax({
// type: "POST",
// url: '/apis/run',
// data: JSON.stringify(codeRunRequest),
// contentType: 'application/json'
// }).done(function (data) {
// showOutput(data);
// $('#btn-run').prop('disabled', false);
// }).fail(function (data) {
// alert("error");
// $('#btn-run').prop('disabled', false);
});
$('#btn-hide-output').click(function () {
$('#btn-hide-output').hide();
$('#btn-show-output').show();
viewConfig.showOutput = false;
windowResized();
});
$('#btn-show-output').click(function () {
$('#btn-hide-output').show();
$('#btn-show-output').hide();
viewConfig.showOutput = true;
windowResized();
});
$('#btn-hide-input').click(function () {
$('#btn-hide-input').hide();
$('#btn-show-input').show();
viewConfig.showInput = false;
windowResized();
});
$('#btn-show-input').click(function () {
$('#btn-hide-input').show();
$('#btn-show-input').hide();
viewConfig.showInput = true;
windowResized();
});
loadLangs();
$(window).resize(function () {
windowResized();
});
windowResized();
});
$('#lang').change(function () {
onLangChanged();
});
function onLangChanged() {
var lang = $('#lang').find(":selected").val();
if (prevLang) {
codeTemplates[prevLang] = editor.getValue();
}
editor.setValue(codeTemplates[lang], -1);
prevLang = lang;
if (lang === 'java7') {
editor.getSession().setMode("ace/mode/java");
} else if (lang === 'python3') {
editor.getSession().setMode("ace/mode/python");
} else if (lang === 'c' || lang === 'c++') {
editor.getSession().setMode("ace/mode/c_cpp");
} else if (lang === 'c
editor.getSession().setMode("ace/mode/csharp");
}
}
function windowResized() {
var aceWrapper = $('#ace_wrapper');
var aceEditor = $('#editor');
var outputWrapper = $('#output-wrapper');
var outputData = $('#output-data');
var inputWrapper = $('#input-wrapper');
var textInput = $('#text-input');
var rightDiff;
var inputHeight;
var outputHeight;
var textInputWidth;
var textInputHeight;
if (viewConfig.showInput || viewConfig.showOutput) {
rightDiff = outputWrapper.width() + 4;
} else {
rightDiff = 0;
}
var aceHeight = window.innerHeight - aceWrapper.position().top;// - bottomPane.height();
var aceWidth = window.innerWidth - rightDiff;
if (viewConfig.showOutput) {
outputWrapper.show();
outputHeight = aceHeight;
} else {
outputWrapper.hide();
outputHeight = 0;
}
if (viewConfig.showInput) {
inputWrapper.show();
inputHeight = 225;
if (viewConfig.showOutput) {
outputHeight -= inputHeight;
} else {
inputHeight = aceHeight;
}
textInputHeight = inputHeight - 62;
textInputWidth = rightDiff - 23;
} else {
inputWrapper.hide();
inputHeight = 0;
}
// var bottomPane = $('#bottom-pane');
// var outputWrapperHeight = aceHeight - inputWrapper.height() - 2;
var outputTextHeight = outputHeight - 52;
aceWrapper.css('height', aceHeight + 'px');
aceWrapper.css('width', aceWidth + 'px');
aceEditor.css('height', aceHeight + 'px');
aceEditor.css('width', aceWidth + 'px');
editor.resize();
if (viewConfig.showOutput) {
outputWrapper.css('height', outputHeight + 'px');
outputData.css('max-height', outputTextHeight + 'px');
}
if (viewConfig.showInput) {
inputWrapper.css('height', inputHeight + 'px');
textInput.css('width', textInputWidth + 'px');
textInput.css('height', textInputHeight + 'px');
// outputData.css('max-height', outputTextHeight + 'px');
}
}
var stompClient;
function connect() {
var socket = new SockJS('/coderun');
stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
// window.alert("connected !");
stompClient.subscribe('/user/queue/reply', function (reply) {
showOutput(JSON.parse(reply.body));
onFinished();
});
});
}
function runCode(codeRunRequest) {
stompClient.send('/iapis/run', {}, JSON.stringify(codeRunRequest));
}
function onRunning() {
$('#btn-run').prop('disabled', true);
$('#icon-running').show();
$('#icon-run').hide();
}
function onFinished() {
$('#btn-run').prop('disabled', false);
$('#icon-running').hide();
$('#icon-run').show();
}
connect();
|
<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
xmlns:xsi="http:
xsi:schemaLocation="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd ">
<head>
<title>Admin</title>
<link rel="stylesheet" type="text/css" href="../../base/default.css"/>
</head>
<body>
<div id="wrapper">
<div id="header" wicket:id="header">
<div id="logo">
<h1><a href="#">Marbles </a></h1>
<p> by <a href="http://my-volk.de/">Thomas Volk</a></p>
</div>
</div>
<!-- end #header -->
<div id="menu" wicket:id="menu">
<ul>
<li wicket:id="items"><a>Home</a></li>
<li wicket:id="items"><a>Test</a></li>
</ul>
</div>
<!-- end #menu -->
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="content">
<wicket:extend>
<div class="pageContent">
<h2>
<wicket:message key="title"/>
</h2>
<div class="messages" wicket:id="messages"></div>
<form wicket:id="updateUserForm">
<div>
<div><label for="name">
<wicket:message key="name"/>
</label></div>
<span wicket:id="name" id="name"/>
</div>
<div>
<div><label for="email">
<wicket:message key="email"/>
</label></div>
<span wicket:id="email" id="email"/>
</div>
<div wicket:id="passwordPanel"></div>
<div class="buttons">
<input type="submit" wicket:id="save"/>
</div>
</form>
</div>
</wicket:extend>
<div style="clear: both;"> </div>
</div>
<!-- end #content -->
<div id="sidebar" wicket:id="sidebar"></div>
<!-- end #sidebar -->
<div style="clear: both;"> </div>
</div>
</div>
</div>
<!-- end #page -->
</div>
<div id="footer" wicket:id="footer">
<p>Copyright (c) 2011 by <a href="http://my-volk.de/">Thomas Volk</a>.</p>
</div>
<!-- end #footer -->
</body>
</html>
|
import {Component, OnInit} from '@angular/core';
import {FundDataService} from '../funddata/funddata.service';
@Component({
selector: 'app-fund-table',
templateUrl: './fund-table.component.html',
styleUrls: ['./fund-table.component.css']
})
export class FundTableComponent implements OnInit {
private colShow: string[] = ['link_linkDisplay', '<API key>', 'oneQuarterAgoChange'];
private columns: string[];
private funds: Object[];
private fundsShow: Object[];
private error: any;
constructor(private fundDataService: FundDataService) {
}
ngOnInit() {
this.fundDataService.loadFunds().subscribe((datas) => {
this.funds = datas;
this.fundsShow = datas;
this.columns = Object.keys(datas[0]);
// console.log('columns: ' + this.columns);
// console.log(JSON.stringify(datas));
}, (err) => {// error
console.log(err);
this.error = err;
}, () => {// complete
});
}
toggleColumn(col: string) {
if (this.colShow.indexOf(col) === -1) {
this.colShow.push(col);
} else {
this.colShow.splice(this.colShow.indexOf(col), 1);
}
}
}
|
package com.appnativa.rare.platform.swing.ui.view;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import javax.swing.Icon;
import javax.swing.JRadioButton;
import com.appnativa.rare.Platform;
import com.appnativa.rare.iConstants;
import com.appnativa.rare.iPlatformAppContext;
import com.appnativa.rare.platform.swing.ui.util.SwingGraphics;
import com.appnativa.rare.ui.ColorUtils;
import com.appnativa.rare.ui.FontUtils;
import com.appnativa.rare.ui.UIColor;
import com.appnativa.rare.ui.UIDimension;
import com.appnativa.rare.ui.iPlatformIcon;
import com.appnativa.rare.ui.painter.iPainter;
import com.appnativa.rare.ui.painter.iPainterSupport;
import com.appnativa.rare.ui.painter.<API key>;
import com.appnativa.util.CharArray;
import com.appnativa.util.XMLUtils;
public class RadioButtonView extends JRadioButton implements iPainterSupport, iView {
protected static iPlatformIcon <API key>;
protected static iPlatformIcon deselectedIcon_;
protected static iPlatformIcon <API key>;
protected static iPlatformIcon <API key>;
protected static iPlatformIcon selectedIcon_;
protected static iPlatformIcon <API key>;
private String originalText;
private boolean wordWrap;
public RadioButtonView() {
super();
initialize();
}
public RadioButtonView(Icon icon) {
super(icon);
initialize();
}
public RadioButtonView(String text) {
super(text);
initialize();
}
public RadioButtonView(String text, Icon icon) {
super(text, icon);
initialize();
}
AffineTransform transform;
protected SwingGraphics graphics;
private <API key> componentPainter;
@Override
public boolean isOpaque() {
return ((componentPainter != null) && componentPainter.<API key>())
? false
: super.isOpaque();
}
@Override
public void setTransformEx(AffineTransform tx) {
transform = tx;
}
@Override
public Color getForeground() {
Color c=super.getForeground();
if(c instanceof UIColor && !isEnabled()) {
c=((UIColor)c).getDisabledColor();
}
return c;
}
@Override
public AffineTransform getTransformEx() {
return transform;
}
@Override
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
AffineTransform tx = g2.getTransform();
if (transform != null) {
g2.transform(transform);
}
graphics = SwingGraphics.fromGraphics(g2, this, graphics);
super.paint(g2);
if (tx != null) {
g2.setTransform(tx);
}
graphics.clear();
}
@Override
protected void paintBorder(Graphics g) {
if (componentPainter == null) {
super.paintBorder(g);
}
}
@Override
protected void paintChildren(Graphics g) {
super.paintChildren(graphics.getGraphics());
<API key> cp = getComponentPainter();
if (cp != null) {
float height = getHeight();
float width = getWidth();
cp.paint(graphics, 0, 0, width, height, iPainter.HORIZONTAL, true);
}
}
@Override
protected void paintComponent(Graphics g) {
graphics = SwingGraphics.fromGraphics(g, this, graphics);
<API key> cp = getComponentPainter();
if (cp != null) {
float height = getHeight();
float width = getWidth();
cp.paint(graphics, 0, 0, width, height, iPainter.HORIZONTAL, false);
}
super.paintComponent(g);
}
@Override
public void setComponentPainter(<API key> cp) {
componentPainter = cp;
}
@Override
public <API key> getComponentPainter() {
return componentPainter;
}
@Override
public void getMinimumSize(UIDimension size, int maxWidth) {
Dimension d = getMinimumSize();
size.width = d.width;
size.height = d.height;
}
@Override
public void setText(String text) {
if (text == null) {
text = "";
}
originalText = text;
int len = text.length();
if (wordWrap && (len > 0) &&!text.startsWith("<html>")) {
CharArray ca = new CharArray(text.length() + 20);
ca.append("<html>");
XMLUtils.escape(text.toCharArray(), 0, len, true, ca);
ca.append("</html>");
text = ca.toString();
}
super.setText(text);
}
public void setWordWrap(boolean wordWrap) {
this.wordWrap = wordWrap;
}
@Override
public String getText() {
return originalText;
}
public boolean isWordWrap() {
return wordWrap;
}
protected void initialize() {
setOpaque(false);
setFont(FontUtils.getDefaultFont());
setForeground(ColorUtils.getForeground());
if (selectedIcon_ == null) {
iPlatformAppContext app = Platform.getAppContext();
if (ColorUtils.getForeground().isDarkColor()) {
selectedIcon_ = app.getResourceAsIcon("Rare.icon.radiobutton.on.light");
deselectedIcon_ = app.getResourceAsIcon("Rare.icon.radiobutton.off.light");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.on.pressed.light");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.off.pressed.light");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.on.disabled.light");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.off.disabled.light");
} else {
selectedIcon_ = app.getResourceAsIcon("Rare.icon.radiobutton.on.dark");
deselectedIcon_ = app.getResourceAsIcon("Rare.icon.radiobutton.off.dark");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.on.pressed.dark");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.off.pressed.dark");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.on.disabled.dark");
<API key> = app.getResourceAsIcon("Rare.icon.radiobutton.off.disabled.dark");
}
}
setSelectedIcon(selectedIcon_);
setDisabledIcon(<API key>);
setPressedIcon(<API key>);
setIcon(deselectedIcon_);
<API key>(<API key>);
}
@Override
public Icon getDisabledIcon() {
Icon icon = super.getDisabledIcon();
if (icon == null) {
icon = getIcon();
if (icon instanceof iPlatformIcon) {
return ((iPlatformIcon) icon).getDisabledVersion();
}
}
return icon;
}
public Icon <API key>() {
Icon icon = super.<API key>();
if (icon == null) {
icon = getSelectedIcon();
if (icon == null) {
icon = getIcon();
}
if (icon instanceof iPlatformIcon) {
return ((iPlatformIcon) icon).getDisabledVersion();
}
}
return icon;
}
private static UIDimension size = new UIDimension();
@Override
public Dimension getPreferredSize() {
if (size == null) {
size = new UIDimension();
}
Number num = (Number) getClientProperty(iConstants.<API key>);
int maxWidth = 0;
if ((num != null) && (num.intValue() > 0)) {
maxWidth = num.intValue();
}
getPreferredSize(size, maxWidth);
return new Dimension(size.intWidth(), size.intHeight());
}
@Override
public void getPreferredSize(UIDimension size, int maxWidth) {
Dimension d = super.getPreferredSize();
size.width = d.width;
size.height = d.height;
if (isFontSet() && getFont().isItalic()) {
if (getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) == null) {
size.width += 4;
}
}
}
}
|
package de.roskenet.simplecms.repository;
import org.springframework.data.repository.<API key>;
import de.roskenet.simplecms.entity.Attribute;
public interface AttributeRepository extends <API key><Attribute, Integer> {
}
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Sequoia: Member List</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Sequoia
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sequoia</b></li><li class="navelem"><b>testing</b></li><li class="navelem"><a class="el" href="../../d3/dcb/<API key>.html"><API key></a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">sequoia::testing::<API key> Member List</div></div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="../../d3/dcb/<API key>.html">sequoia::testing::<API key></a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>auxiliary_materials</b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>basic_test</b>(std::string name) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>basic_test</b>(const basic_test &)=delete (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>basic_test</b>(basic_test &&) noexcept=default (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b><API key></b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>duration</b> typedef (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>execute</b>(std::optional< std::size_t > index) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>mode</b> (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>name</b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>operator=</b>(const basic_test &)=delete (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>operator=</b>(basic_test &&) noexcept=default (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b><API key></b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>report_line</b>(const std::filesystem::path &file, int line, std::string_view message) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>set_filesystem_data</b>(std::filesystem::path testRepo, const std::filesystem::path &outputDir, std::string_view familyName) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>set_materials</b>(std::filesystem::path workingMaterials, std::filesystem::path predictiveMaterials, std::filesystem::path auxiliaryMaterials) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>set_recovery_paths</b>(recovery_paths paths) (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>source_filename</b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../d0/d16/<API key>.html#<API key>">summarize</a>(duration delta) const</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>test_repository</b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>working_materials</b>() const noexcept (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>~basic_test</b>()=default (defined in <a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a>)</td><td class="entry"><a class="el" href="../../d0/d16/<API key>.html">sequoia::testing::basic_test< Checker ></a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&
</small></address>
</body>
</html>
|
require('dotenv').config({ silent: true });
var Express = require('express');
var path = require('path');
var fs = require('fs');
var merge = require('lodash/merge');
var proxy = require('proxy-middleware');
var ejs = require('ejs');
var config = require('./config');
var server = new Express();
server.set('port', config.PORT);
server.engine('html', require('ejs').renderFile);
server.set('view engine', 'ejs');
server.set('views', path.resolve(__dirname, '../www'));
server.locals.CONFIG = escape(JSON.stringify(config));
server.use(config.API_PROXY_PATH, proxy(config.API_ENDPOINT));
server.get('/', function (req, res) {
res.render('index.html');
});
server.use(Express.static(path.resolve(__dirname, '../www')));
server.get('/404', function (req, res) {
res.render('404.html');
});
server.listen(server.get('port'), function (err) {
if (err) {
console.log('error while starting server', err);
}
console.log('Gandalf is started to listen at localhost:' + server.get('port'));
});
|
/* This file is part of the 'orilib' software. */
/* see the COPYING file in the top-level directory.*/
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef OL_DIS_DEP_H
#define OL_DIS_DEP_H
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<float.h>
#define isNaN(x) ((x) != (x))
#include"ut.h"
#include"../ol_set.h"
#endif /* OL_DIS_DEP_H */
#ifdef __cplusplus
}
#endif
|
package de.fraunhofer.fokus.upnp.core;
import java.util.Hashtable;
import java.util.Vector;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import de.fraunhofer.fokus.upnp.util.SAXTemplateHandler;
/**
* This class is used to parse UPnPDoc messages.
*
* @author Alexander Koenig
*
*
*/
public class UPnPDocParser extends SAXTemplateHandler
{
/** Doc entries for the current service type */
private Vector currentDocEntryList = new Vector();
private boolean isAction = false;
private boolean isStateVariable = false;
private String currentServiceType = null;
private String currentArgumentName = null;
private String <API key> = null;
private UPnPDocEntry currentDocEntry = null;
/** Hashtable containing the UPnP doc entry list for one service type */
private Hashtable <API key> = new Hashtable();
/*
* (non-Javadoc)
*
* @see de.fraunhofer.fokus.upnp.util.SAXTemplateHandler#processStartElement(java.lang.String,
* java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
public void processStartElement(String uri, String name, String name2, Attributes atts) throws SAXException
{
if (getTagCount() == 2)
{
for (int i = 0; i < atts.getLength(); i++)
{
if (atts.getQName(i).equalsIgnoreCase("serviceType"))
{
currentServiceType = atts.getValue(i);
currentDocEntryList = new Vector();
}
}
}
if (getTagCount() == 3 && currentServiceType != null)
{
isAction = getCurrentTag().equalsIgnoreCase("actionList");
isStateVariable = getCurrentTag().equalsIgnoreCase("serviceStateTable");
}
if (getTagCount() == 4 && currentServiceType != null)
{
currentDocEntry = new UPnPDocEntry(currentServiceType);
}
}
/*
* (non-Javadoc)
*
* @see de.fraunhofer.fokus.upnp.util.SAXTemplateHandler#processEndElement(java.lang.String,
* java.lang.String, java.lang.String)
*/
public void processEndElement(String uri, String localName, String name) throws SAXException
{
if (getTagCount() == 6 && isAction && currentDocEntry != null && currentArgumentName != null &&
<API key> != null)
{
currentDocEntry.<API key>(currentArgumentName, <API key>);
currentArgumentName = null;
<API key> = null;
}
if (getTagCount() == 4)
{
if (currentDocEntry != null && currentDocEntry.getActionName() != null && isAction)
{
// TemplateService.printMessage(" Add doc entry for action " +
// currentDocEntry.getActionName());
currentDocEntryList.add(currentDocEntry);
}
if (currentDocEntry != null && currentDocEntry.<API key>() != null && isStateVariable)
{
// TemplateService.printMessage(" Add doc entry for state variable " +
// currentDocEntry.<API key>());
currentDocEntryList.add(currentDocEntry);
}
currentDocEntry = null;
}
if (getTagCount() == 3)
{
isAction = false;
isStateVariable = false;
}
if (getTagCount() == 2)
{
// store list with doc entries for one service type
<API key>.put(currentServiceType, currentDocEntryList);
currentServiceType = null;
currentDocEntryList = null;
}
}
/*
* (non-Javadoc)
*
* @see de.fraunhofer.fokus.upnp.util.SAXTemplateHandler#<API key>(java.lang.String)
*/
public void <API key>(String content) throws SAXException
{
if (getTagCount() == 5 && currentDocEntry != null)
{
if (getCurrentTag().equalsIgnoreCase("name") && isAction)
{
currentDocEntry.setActionName(content.trim());
}
if (getCurrentTag().equalsIgnoreCase("name") && isStateVariable)
{
currentDocEntry.<API key>(content.trim());
}
if (getCurrentTag().equalsIgnoreCase("description"))
{
currentDocEntry.setDescription(content.trim());
}
}
if (getTagCount() == 7 && currentDocEntry != null)
{
if (getCurrentTag().equalsIgnoreCase("name"))
{
currentArgumentName = content.trim();
}
if (getCurrentTag().equalsIgnoreCase("description"))
{
<API key> = content.trim();
}
}
}
/**
* Retrieves the upnpDocEntryTable.
*
* @return The upnpDocEntryTable
*/
public Hashtable <API key>()
{
return <API key>;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.