Skip to content

Commit

Permalink
Make classes static
Browse files Browse the repository at this point in the history
  • Loading branch information
n-stefan committed Jun 12, 2024
1 parent 8304ea0 commit 9f76d1d
Show file tree
Hide file tree
Showing 85 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CAnimation
internal Tile32 tile; /*!< Top-left tile of Animation. */
}

class Animation
static class Animation
{
const byte ANIMATION_MAX = 112;

Expand Down
2 changes: 1 addition & 1 deletion Audio/Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MSBuffer
internal MSData[] buffer; /*!< ?? */
}

class Driver
static class Driver
{
static readonly bool[] s_driverInstalled = new bool[16];
static readonly bool[] s_driverLoaded = new bool[16];
Expand Down
2 changes: 1 addition & 1 deletion Audio/DspNone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Audio;

class DspNone
static class DspNone
{
internal static bool DSP_Init() => true;

Expand Down
2 changes: 1 addition & 1 deletion Audio/DspSdl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Audio;

class DspSdl
static class DspSdl
{
static nint s_buffer;
static uint s_bufferLen;
Expand Down
2 changes: 1 addition & 1 deletion Audio/MidiNone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Audio;

class MidiNone
static class MidiNone
{
internal static bool Midi_Init() => true;

Expand Down
2 changes: 1 addition & 1 deletion Audio/Mt32Mpu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal MSData()
internal int[] noteOnDuration = new int[MAX_NOTES]; /*!< ?? */
}

class Mt32Mpu
static class Mt32Mpu
{
/* defines from AIL XMIDI.ASM : */
internal const int NUM_CHANS = 16;
Expand Down
2 changes: 1 addition & 1 deletion Audio/Sound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Feedback
internal ushort soundId; /*!< Sound. */
}

class Sound
static class Sound
{
/* Number of voices in the game. */
const byte NUM_VOICES = 131;
Expand Down
2 changes: 1 addition & 1 deletion Codec/Format40.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Codec;

class Format40
static class Format40
{
/*
* Decode a memory fragment which is encoded with 'format40'.
Expand Down
2 changes: 1 addition & 1 deletion Codec/Format80.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Codec;

class Format80
static class Format80
{
/*
* Decode a memory fragment which is encoded with 'format80'.
Expand Down
2 changes: 1 addition & 1 deletion Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DuneCfg
[FieldOffset(9)] internal byte checksum; /*!< Used to check validity on config data. See Config_Read(). */
}

class Config
static class Config
{
internal static GameCfg g_gameConfig = new() { music = 1, sounds = 1, gameSpeed = 2, hints = 1, autoScroll = 0 };
internal static DuneCfg g_config = new();
Expand Down
2 changes: 1 addition & 1 deletion CrashLog/CrashLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.CrashLog;

class CrashLog
static class CrashLog
{
internal static void CrashLog_Init()
{
Expand Down
2 changes: 1 addition & 1 deletion Cutscene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CreditPosition
internal ushort y;
}

class Cutscene
static class Cutscene
{
internal static bool g_canSkipIntro; /*!< When true, you can skip the intro by pressing a key or clicking. */

Expand Down
2 changes: 1 addition & 1 deletion Explosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal CExplosion() =>
position = new Tile32();
}

class Explosion
static class Explosion
{
internal const byte EXPLOSION_MAX = 32; /*!< The maximum amount of active explosions we can have. */

Expand Down
2 changes: 1 addition & 1 deletion File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PakFileInfoLinkedElem
internal string filenamebuffer; //char[1]
}

class File
static class File
{
//readonly string SEARCHDIR_GLOBAL_DATA_DIR = Path.Combine(Environment.CurrentDirectory, "data");
//readonly string SEARCHDIR_PERSONAL_DATA_DIR = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
Expand Down
2 changes: 1 addition & 1 deletion Gfx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DirtyArea
internal ushort bottom;
}

class Gfx
static class Gfx
{
static bool s_screen0_is_dirty;
static readonly DirtyArea s_screen0_dirty_area = new() { left = 0, top = 0, right = 0, bottom = 0 };
Expand Down
2 changes: 1 addition & 1 deletion Gui/EditBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Gui;

class EditBox
static class EditBox
{
static uint tickEditBox; /* Ticker for cursor blinking. */
static bool editBoxShowCursor; /* Cursor is active. */
Expand Down
2 changes: 1 addition & 1 deletion Gui/Font.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CFont
internal FontChar[] chars;
}

class Font
static class Font
{
internal static CFont g_fontIntro;
internal static CFont g_fontNew6p;
Expand Down
2 changes: 1 addition & 1 deletion Gui/Gui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class RankScore
internal ushort score; /*!< Score needed to obtain the rank. */
}

class Gui
static class Gui
{
internal static byte[] g_remap = new byte[256];

Expand Down
2 changes: 1 addition & 1 deletion Gui/Mentat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MentatInfo
internal uint length;
}

class Mentat
static class Mentat
{
/*
* Information about the mentat.
Expand Down
2 changes: 1 addition & 1 deletion Gui/Security.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Gui;

class Security
static class Security
{
/*
* Ask the security question to the user. Give him 3 times. If he fails,
Expand Down
2 changes: 1 addition & 1 deletion Gui/Viewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Gui;

class Viewport
static class Viewport
{
static uint s_tickCursor; /*!< Stores last time Viewport changed the cursor spriteID. */
static uint s_tickMapScroll; /*!< Stores last time Viewport ran MapScroll function. */
Expand Down
2 changes: 1 addition & 1 deletion Gui/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class WidgetScrollbar
internal ScrollbarDrawProc drawProc; /*!< Draw proc (called on every draw). Can be null. */
}

class Widget
static class Widget
{
/* Layout and other properties of the widgets. */
internal static WidgetProperties[] g_widgetProperties = [ //[22]
Expand Down
2 changes: 1 addition & 1 deletion Gui/WidgetClick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Gui;

class WidgetClick
static class WidgetClick
{
static ushort s_savegameIndexBase;
static ushort s_savegameCountOnDisk; /*!< Amount of savegames on disk. */
Expand Down
2 changes: 1 addition & 1 deletion Gui/WidgetDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Gui;

class WidgetDraw
static class WidgetDraw
{
/*
* Draw the panel on the right side of the screen, with the actions of the
Expand Down
2 changes: 1 addition & 1 deletion House.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class HouseInfo
internal string voiceFilename; /*!< Pointer to filename with the voices of the house. */
}

class House
static class House
{
/*
* HouseAnimation flags
Expand Down
2 changes: 1 addition & 1 deletion IniFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune;

class IniFile
static class IniFile
{
static string g_sharpduneini;

Expand Down
2 changes: 1 addition & 1 deletion Input/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum InputFlagsEnum
INPUT_FLAG_UNKNOWN_2000 = 0x2000 /*!< ?? */
}

class Input
static class Input
{
static readonly ushort[] s_history = new ushort[128]; /*!< History of input commands. */
static ushort s_historyHead; /*!< The current head inside the #s_history array. */
Expand Down
2 changes: 1 addition & 1 deletion Input/Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Input;

class Mouse
static class Mouse
{
internal static ushort g_mouseLock; /*!< Lock for when handling mouse movement. */
internal static ushort g_mouseX; /*!< Current X position of the mouse. */
Expand Down
2 changes: 1 addition & 1 deletion Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune;

class Load
static class Load
{
/*
* In case the current house is Mercenary, another palette is loaded.
Expand Down
2 changes: 1 addition & 1 deletion Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MapInfo
internal ushort sizeY; /*!< Height of the map. */
}

class Map
static class Map
{
internal static ushort[] g_mapTileID = new ushort[64 * 64];

Expand Down
2 changes: 1 addition & 1 deletion Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ObjectInfo
internal byte availableHouse; /*!< To which house this Structure / Unit is available. */
}

class Object
static class Object
{
/*
* Clear variable4 in a safe (and recursive) way from an object.
Expand Down
2 changes: 1 addition & 1 deletion Os/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Os;

class Common
static class Common
{
internal static bool AreArraysEqual(Span<byte> array1, int index1, Span<byte> array2, int index2, int count)
{
Expand Down
2 changes: 1 addition & 1 deletion Os/Endian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Os;

class Endian
static class Endian
{
static ushort Endian_BSwap16(ushort x) =>
(ushort)((x & 0xFF00) >> 8 | (x & 0x00FF) << 8);
Expand Down
2 changes: 1 addition & 1 deletion Os/Math.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Os;

class Math
static class Math
{
internal static short Clamp(short a, short b, short c) =>
System.Math.Min(System.Math.Max(a, b), c);
Expand Down
2 changes: 1 addition & 1 deletion Os/Sleep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.Os;

class Sleep
static class Sleep
{
#if !WITH_SDL && !WITH_SDL2
internal static void SleepIdle() =>
Expand Down
2 changes: 1 addition & 1 deletion Pool/PoolHouse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.Pool;

class PoolHouse
static class PoolHouse
{
enum HouseIndex
{
Expand Down
2 changes: 1 addition & 1 deletion Pool/PoolStructure.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.Pool;

class PoolStructure
static class PoolStructure
{
internal enum StructureIndex
{
Expand Down
2 changes: 1 addition & 1 deletion Pool/PoolTeam.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.Pool;

class PoolTeam
static class PoolTeam
{
enum TeamIndex
{
Expand Down
2 changes: 1 addition & 1 deletion Pool/PoolUnit.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.Pool;

class PoolUnit
static class PoolUnit
{
internal enum UnitIndex
{
Expand Down
2 changes: 1 addition & 1 deletion Save.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace SharpDune;

delegate bool SaveProc(BinaryWriter bw);

class Save
static class Save
{
/*
* Save the game to a filename
Expand Down
2 changes: 1 addition & 1 deletion SaveLoad/SaveLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SaveLoadDesc
//internal object address; /*!< The address of the element. */
}

class SaveLoad
static class SaveLoad
{
//static int offset(Type c, string m) //(((size_t)&((c *)8)->m) - 8)
//{
Expand Down
2 changes: 1 addition & 1 deletion SaveLoad/SaveLoadHouse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.SaveLoad;

class SaveLoadHouse
static class SaveLoadHouse
{
static readonly SaveLoadDesc[] s_saveHouse = [
SLD_ENTRY2(SLDT_UINT16, nameof(CHouse.index), SLDT_UINT8),
Expand Down
2 changes: 1 addition & 1 deletion SaveLoad/SaveLoadInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpDune.SaveLoad;

class SaveLoadInfo
static class SaveLoadInfo
{
static readonly SaveLoadDesc[] s_saveInfo = [
SLD_GSLD(() => g_scenario, g_saveScenario),
Expand Down
2 changes: 1 addition & 1 deletion SaveLoad/SaveLoadMap.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.SaveLoad;

class SaveLoadMap
static class SaveLoadMap
{
/*
* Load a Tile structure to a file (Little endian)
Expand Down
2 changes: 1 addition & 1 deletion SaveLoad/SaveLoadObject.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SharpDune.SaveLoad;

class SaveLoadObject
static class SaveLoadObject
{
internal static readonly SaveLoadDesc[] g_saveObject = [
SLD_ENTRY(SLDT_UINT16, nameof(CObject.index)),
Expand Down
Loading

0 comments on commit 9f76d1d

Please sign in to comment.