os x compat and basic app packaging

This commit is contained in:
pchote
2010-02-18 23:21:24 +13:00
parent 15034dd55b
commit ea6dbfc092
8 changed files with 51 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ namespace OpenRa.Graphics
public ITexture PaletteTexture;
readonly Font fDebug, fTitle;
//readonly Font fDebug, fTitle;
Sheet textSheet;
SpriteRenderer rgbaRenderer;
@@ -60,8 +60,8 @@ namespace OpenRa.Graphics
RgbaSpriteShader = device.CreateShader(FileSystem.Open("chrome-rgba.fx"));
WorldSpriteShader = device.CreateShader(FileSystem.Open("chrome-shp.fx"));
fDebug = new Font("Tahoma", 10, FontStyle.Regular);
fTitle = new Font("Tahoma", 10, FontStyle.Bold);
//fDebug = new Font("Tahoma", 10, FontStyle.Regular);
//fTitle = new Font("Tahoma", 10, FontStyle.Bold);
textSheet = new Sheet(this, new Size(256, 256));
rgbaRenderer = new SpriteRenderer(this, true, RgbaSpriteShader);
textSprite = new Sprite(textSheet, new Rectangle(0, 0, 256, 256), TextureChannel.Alpha);
@@ -157,7 +157,7 @@ namespace OpenRa.Graphics
public void DrawText(string text, int2 pos, Color c)
{
return;
using (new PerfSample("text"))
using (new PerfSample("text"))
{
Bitmap b = RenderTextToBitmap(text, fDebug, c);
textSheet.Texture.SetData(b);
@@ -169,7 +169,7 @@ namespace OpenRa.Graphics
public void DrawText2(string text, int2 pos, Color c)
{
return;
using (new PerfSample("text"))
using (new PerfSample("text"))
{
Bitmap b = RenderTextToBitmap(text, fTitle, c);
textSheet.Texture.SetData(b);
@@ -180,12 +180,12 @@ namespace OpenRa.Graphics
public int2 MeasureText(string text)
{
return GetTextSize(text, fDebug);
return new int2(0,0); //GetTextSize(text, fDebug);
}
public int2 MeasureText2(string text)
{
return GetTextSize(text, fTitle);
return new int2(0,0);// GetTextSize(text, fTitle);
}
}
}

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
@@ -58,8 +58,9 @@ namespace OpenRa.GlRenderer
{
Glfw.glfwInit();
Glfw.glfwOpenWindow(width, height, 0, 0, 0, 0, 0, 0,
/*fullscreen ? Glfw.GLFW_FULLSCREEN : */Glfw.GLFW_WINDOW);
/*fullscreen ? Glfw.GLFW_FULLSCREEN : */Glfw.GLFW_WINDOW);
Glfw.glfwSetWindowTitle("OpenRA");
bool initDone = false;
var lastButtonBits = (MouseButtons)0;
@@ -90,8 +91,9 @@ namespace OpenRa.GlRenderer
windowCloseCallback = () =>
{
OpenRa.Game.Exit();
Glfw.glfwIconifyWindow();
return Gl.GL_FALSE;
// This looks lame on os x
//Glfw.glfwIconifyWindow();
return Gl.GL_FALSE;
};
Glfw.glfwSetWindowTitle("OpenRA");

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>OpenRA</string>
<key>CFBundleExecutable</key>
<string>OpenRA</string>
<key>CFBundleIconFile</key>
<string>OpenRa.icns</string>
</dict>
</plist>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>OpenRa Server</string>
<key>CFBundleExecutable</key>
<string>OpenRa Server</string>
<key>CFBundleIconFile</key>
<string>OpenRa.icns</string>
</dict>
</plist>

BIN
packaging/osx/OpenRA.icns Normal file

Binary file not shown.

5
packaging/osx/package.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
macpack -mode:console -n "OpenRa Server" -r OpenRa.FileFormats.dll,packaging/osx/OpenRa.icns OpenRa.Server.exe
cp packaging/osx/Info_server.plist "OpenRa Server.app/Contents/Info.plist"
macpack -mode:winforms -n OpenRA -r OpenRa.FileFormats.dll,OpenRa.Gl.dll,libglfw.dylib,allies.mix,conquer.mix,expand2.mix,general.mix,hires.mix,interior.mix,redalert.mix,russian.mix,snow.mix,sounds.mix,temperat.mix,packaging/osx/settings.ini,line.fx,chrome-shp.fx,chrome-rgba.fx,bogus.sno,bogus.tem,world-shp.fx,tileSet.til,templates.ini,packaging/osx/OpenRa.icns,mods OpenRa.Game.exe
cp packaging/osx/Info_game.plist "OpenRa.app/Contents/Info.plist"

View File

@@ -0,0 +1,7 @@
[Settings]
NetworkHost=localhost
NetworkPort=1234
InitialMods=ra
Width=1024
Height=768
PerfGraph=false

View File

@@ -2,6 +2,6 @@
<dllmap dll="glfw.dll">
<dllentry os="linux" dll="libglfw.so.2" />
<dllentry os="windows" dll="glfw.dll" />
<dllentry os="osx" dll="libglfw.so" />
<dllentry os="osx" dll="libglfw.dylib" />
</dllmap>
</configuration>